RingSoft.DbLookup.Controls.WPF.Properties Namespace
RingSoft.DbMaintenance Namespace

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.AutoFill
Assembly:  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


ExceptionCondition
ArgumentExceptionForeign key field does not have a parent foreign key definition. Make sure you configure it properly in the Entity Framework.
ArgumentExceptionParent 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()