You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ActiveRecord/Entity/DatabaseGetters/GetById.vb
+85-68Lines changed: 85 additions & 68 deletions
Original file line number
Diff line number
Diff line change
@@ -2,77 +2,94 @@
2
2
ImportsSystem.Dynamic
3
3
4
4
NamespaceActiveRecord
5
-
PartialPublicMustInheritClassEntity
6
-
InheritsDynamicObject
5
+
PartialPublicMustInheritClassEntity
6
+
InheritsDynamicObject
7
7
8
-
''' <summary>
9
-
''' Get active record entity instance by autoincrement column, there will be loaded all table columns.
10
-
''' </summary>
11
-
''' <typeparam name="TValue">Model class type, inherited from ActiveRecord.</typeparam>
12
-
''' <param name="connectionIndex">Config connection index to use different database, default by 0 to use first connection in <connectionStrings> list.</param>
''' Get active record entity instance by autoincrement column, there will be loaded all table columns.
10
+
''' </summary>
11
+
''' <typeparam name="TValue">Model class type, inherited from ActiveRecord.</typeparam>
12
+
''' <param name="connectionIndex">Config connection index to use different database, default by 0 to use first connection in <connectionStrings> list.</param>
''' Get active record entity instance by autoincrement column, there will be loaded all table columns.
22
-
''' </summary>
23
-
''' <typeparam name="TValue">Model class type, inherited from ActiveRecord.</typeparam>
24
-
''' <param name="connectionName">Config connection name to use different database, default by Databasic.Defaults.CONNECTION_INDEX to use first connection in <connectionStrings> list.</param>
''' Get active record entity instance by autoincrement column, there will be loaded all table columns.
30
+
''' </summary>
31
+
''' <typeparam name="TValue">Model class type, inherited from ActiveRecord.</typeparam>
32
+
''' <param name="connectionName">Config connection name to use different database, default by Databasic.Defaults.CONNECTION_INDEX to use first connection in <connectionStrings> list.</param>
33
+
''' <returns></returns>
34
+
PublicSharedFunctionGetById(OfTValue)(
35
+
idAsInt64,
36
+
connectionNameAsString
37
+
)AsTValue
38
+
ReturnEntity.GetById(OfTValue)(
39
+
id,Connection.Get(If(
40
+
String.IsNullOrEmpty(connectionName),
41
+
Tools.GetConnectionIndexByClassAttr(
42
+
GetType(TValue),True
43
+
),
44
+
connectionName
45
+
))
46
+
)
47
+
EndFunction
35
48
36
-
''' <summary>
37
-
''' Get active record entity instance by autoincrement column, there will be loaded all table columns.
38
-
''' </summary>
39
-
''' <typeparam name="TValue">Model class type, inherited from ActiveRecord.</typeparam>
0 commit comments