To load by primary key, a unique single primary key must be defined on the table. Primary keys are automatically mapped. See Mapping Primary Keys for more information.
'Create a new Person to save to the database
Dim
person As New Person()person.FirstName =
"John"person.LastName =
"Smith"person.DateCreated =
Date.Now'Get the current instance of the helper
Dim
db As IDataHelper = DataHelper.SessionFactory()
'Save it
db.Save(person)
'Load by primary key
Dim
personCopy As Person = db.LoadByPrimaryKey(Of Person)(person.PersonId)