'Get the current thread static safe instance of the helper
Dim db As IDataHelper = DataHelper.SessionFactory()
'Specify User Name and License Key from the receipt, leave blank for trial mode
'db.UserName = "John Smith 1234"
'db.LicenseKey = "asdfl219=="
' Open the database connection
db.OpenConnection()
' Clear table Person
db.TruncateTable("Person")
' Create Persons to save to the database
Dim persons As New List(Of Person)() From {
New Person With {.FirstName = "Han", .LastName = "Solo"},
New Person With {.FirstName = "Luke", .LastName = "Skywalker"},
New Person With {.FirstName = "Leia", .LastName = "Organa"},
New Person With {.FirstName = "Obi-Wan", .LastName = "Kenobi"},
New Person With {.FirstName = "Padme", .LastName = "Amidala"}}
' Save them to the database
db.Save(persons)
'INSTANT VB TODO TASK: Assignments within expressions are not supported in VB
'ORIGINAL LINE: var result = db.LoadPage(Of Person)("WHERE LastName <> @LastName", New Dictionary(Of string, object) { { "@LastName", "Organa" } }, "ORDER BY FirstName", 2, 2);
Dim result = db.LoadPage(Of Person)("WHERE LastName <> @LastName", New Dictionary(Of String, Object) From {{ "@LastName", "Organa" }}, "ORDER BY FirstName", 2, 2)
'INSTANT VB TODO TASK: Assignments within expressions are not supported in VB
'ORIGINAL LINE: result = db.LoadPage(Of Person)("FirstName <> @FirstName", New Dictionary(Of string, object) { { "@FirstName", "Han" } }, "LastName", 2, 2);
result = db.LoadPage(Of Person)("FirstName <> @FirstName", New Dictionary(Of String, Object) From {{ "@FirstName", "Han" }}, "LastName", 2, 2)
' Close the connection
db.CloseConnection()