//Get the current thread static safe instance of the helper
IDataHelper db = 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
List<Person> persons = new List<Person>
{
new Person
{
FirstName = "Han",
LastName = "Solo",
PersonTypeId = 1
},
new Person
{
FirstName = "Luke",
LastName = "Skywalker",
PersonTypeId = 1
},
new Person
{
FirstName = "Leia",
LastName = "Organa",
PersonTypeId = 1
},
new Person
{
FirstName = "Obi-Wan",
LastName = "Kenobi",
PersonTypeId = 2
},
new Person
{
FirstName = "Padme",
LastName = "Amidala",
PersonTypeId = 1
},
};
// Save them to the database
db.Save(persons);
Person searchParameters = new Person { PersonTypeId = 1 };
var result = db.Search<Person>(searchParameters, 2, 2);
// Close the connection
db.CloseConnection();