Knight Data Access Layer
Maintenance Fields VB.NET
Basic Tasks VB.NET > Mapping > Maintenance Fields VB.NET

Maintenance fields are specially named fields that are automatically filled in when inserting and deleting. 

 

Example:

Public Class Vendor

'This is the primary key (See also the Primary Keys topic)

Public Property VendorID() As Integer

 

'This is not a special field, it is simply a string property

Public Property Name() As String

 

'Optional. On insert, this property will be set to DateTime.Now

Public Property CreateDate() As Date?

 

' Optional. On update, this property will be set to DateTime.Now

Public Property UpdateDate() As Date?

 

' Optional. On insert, this property will be set to Environment.UserName

Public Property CreateUser() As String

 

' Optional. On update, this property will be set to Environment.UserName

Public Property UpdateUser() As String

 

' Optional. On update, this property will be set to Environment.MachineName

Public Property MachineName() As String

End Class