Is there a table or primary key property in the DDT that sets the BO to PrimaryKeyIsAutoIncremented to true and PrimaryKeyIsUpdatable = false?
Paul answered the question as to why the field property exists in the DDT perfectly. As for having a property that sets these properties, you really just need to create a base BO and inherit your BOs from the base BO with these properties set, this way you don't have to set them each time.
Imports MicroFour.StrataFrame.Business
Imports System.ComponentModel
Public Class MyBaseBO
Inherits MicroFour.StrataFrame.Business.BusinessLayer
#Region " Private Fields "
Private _PrimaryKeyIsAutoIncremented As Boolean = False
Private _PrimaryKeyIsUpdatable As Boolean = True
#End Region
#Region " Public Properties "
''' <summary>
''' Gets or sets a value that determines whether the primary key for this business object is
''' auto-incremented within the data source (assigned by the database rather than by the
''' client).
''' </summary>
<Category(EDITOR_CATEGORY_CRUD), _
DefaultValue(False)> _
Public Overrides Property PrimaryKeyIsAutoIncremented() As Boolean
Get
Return _PrimaryKeyIsAutoIncremented
End Get
Set(ByVal value As Boolean)
_PrimaryKeyIsAutoIncremented = value
End Set
End Property
''' <summary>
''' Determines if the primary key field is updatable. This property allows primary key fields that are not auto-incrementing to be used while
''' preventing an update error if the field is not updatable (i.e. Guid Primary Keys).
''' </summary>
<Category(EDITOR_CATEGORY_CRUD), _
DefaultValue(True)> _
Public Overrides Property PrimaryKeyIsUpdatable() As Boolean
Get
Return _PrimaryKeyIsUpdatable
End Get
Set(ByVal value As Boolean)
_PrimaryKeyIsUpdatable = value
End Set
End Property
#End Region
End Class
Note: You will need to be on 1.6.6 beta and load the attached business assembly into the GAC in order for this to work. I had to add the Overridable tab to the PrimaryKeyIsAutoIncremented and PrimarykeyIsUpdatable properties.