AutoFillSetup Constructor (FieldDefinition)
Initializes a new instance of the class with a lookup definition that is attached to the primary table of the parent join definition of the foreign field definition parameter.
Namespace:
RingSoft.DbLookup.AutoFillAssembly: RingSoft.DbLookup (in RingSoft.DbLookup.dll)
Syntax
public AutoFillSetup( FieldDefinition foreignKeyFieldDefinition )
Public Sub New ( _ foreignKeyFieldDefinition As FieldDefinition _ )
public: AutoFillSetup( FieldDefinition^ foreignKeyFieldDefinition )
Parameters
- foreignKeyFieldDefinition
- Type: RingSoft.DbLookup.ModelDefinition.FieldDefinitions..::..FieldDefinition
The foreign key field definition whose value will be set in the AutoFillValue's PrimaryKeyValue property value.
Exceptions
Exception | Condition |
---|---|
ArgumentException | Foreign key field does not have a parent foreign key definition. Make sure you configure it properly in the Entity Framework. |
ArgumentException | Parent table '{foreignKeyFieldDefinition.ParentJoinForeignKeyDefinition.PrimaryTable}' does not have a lookup definition. Make sure you attach it in the LookupContext.InitializeLookupDefinitions override and execute {foreignKeyFieldDefinition.ParentJoinForeignKeyDefinition.PrimaryTable}.HasLookupDefinition() |