Click or drag to resize
DBTableCreateNewFkConstraintIfNecessary Method
Creates a new fk constraint if necessary. Flags all fk constraints which are already formed by the Fk fields as deleted first.

Namespace:  SD.LLBLGen.Pro.DBDriverCore
Assembly:  SD.LLBLGen.Pro.DBDriverCore (in SD.LLBLGen.Pro.DBDriverCore.dll) Version: 5.3.0.0 (5.3.0)
Syntax
public DBForeignKeyConstraint CreateNewFkConstraintIfNecessary(
	List<Pair<IProjectElementFieldMapTargetElement, IProjectElementFieldMapTargetElement>> fieldPairs,
	string fkName,
	Action<string> messageReportingFunc,
	bool forModelOnlyRelationship,
	out bool created
)

Parameters

fieldPairs
Type: System.Collections.GenericListPairIProjectElementFieldMapTargetElement, IProjectElementFieldMapTargetElement
The field pairs. Value1 is Fk field, Value2 is Pk field
fkName
Type: SystemString
Name of the fk to create. Name is created from settings though not made unique across the db.
messageReportingFunc
Type: SystemActionString
The message reporting func. If specified, it is used to report a normal message to calling code's outer structures
forModelOnlyRelationship
Type: SystemBoolean
if set to true the fk is for a model-only relationship and only an existing FK, which isn't deleted matching the fields is returned
created
Type: SystemBoolean
if set to true this method created a new fk constraint. Set to false if the FK constraint was already present.

Return Value

Type: DBForeignKeyConstraint
the foreign key constraint created or the one which is already there (so a new one wasn't necessary), or null if something was wrong
See Also