Normally IsNew is not required to be implemented because the record is detected as new if the primary key is the default value. If you have a table that has a composite key, IsNew is useful for inserting new records. If there is an IsNew property and it is true, OR if the primary key is the default value, then the object will be inserted.
Public
Class SalesPeople
<CompositeKey>
Public
Property Region() As String
<CompositeKey>
Public
Property Salesman() As String
Public
Property Sales() As DecimalPublic
Property IsNew() As BooleanPublic
Property IsDirty() As Boolean
Sub New()Public
TrueIsNew =
IsDirty =
FalseEnd
SubEnd
Class
'Get the current instance of the helper
Private
db As IDataHelper = DataHelper.SessionFactory()
Private
salesPerson As New SalesPeople()salesPerson.IsNew =
TruesalesPerson.Region =
"Northwest"salesPerson.Salesman =
"Buckaroo Banzai"db.Save(salesPerson)