Create a ForeignKey for the columns in the Table.

Namespace: NHibernate.Mapping
Assembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)

Syntax

C#
public virtual ForeignKey CreateForeignKey(
	string keyName,
	IEnumerable<Column> keyColumns,
	string referencedEntityName,
	IEnumerable<Column> referencedColumns
)
Visual Basic
Public Overridable Function CreateForeignKey ( _
	keyName As String, _
	keyColumns As IEnumerable(Of Column), _
	referencedEntityName As String, _
	referencedColumns As IEnumerable(Of Column) _
) As ForeignKey
Visual C++
public:
virtual ForeignKey^ CreateForeignKey(
	String^ keyName, 
	IEnumerable<Column^>^ keyColumns, 
	String^ referencedEntityName, 
	IEnumerable<Column^>^ referencedColumns
)

Parameters

keyName
Type: System..::..String

[Missing <param name="keyName"/> documentation for "M:NHibernate.Mapping.Table.CreateForeignKey(System.String,System.Collections.Generic.IEnumerable{NHibernate.Mapping.Column},System.String,System.Collections.Generic.IEnumerable{NHibernate.Mapping.Column})"]

keyColumns
Type: System.Collections.Generic..::..IEnumerable<(Of <(<'Column>)>)>
An IList of Column objects.
referencedEntityName
Type: System..::..String

[Missing <param name="referencedEntityName"/> documentation for "M:NHibernate.Mapping.Table.CreateForeignKey(System.String,System.Collections.Generic.IEnumerable{NHibernate.Mapping.Column},System.String,System.Collections.Generic.IEnumerable{NHibernate.Mapping.Column})"]

referencedColumns
Type: System.Collections.Generic..::..IEnumerable<(Of <(<'Column>)>)>

[Missing <param name="referencedColumns"/> documentation for "M:NHibernate.Mapping.Table.CreateForeignKey(System.String,System.Collections.Generic.IEnumerable{NHibernate.Mapping.Column},System.String,System.Collections.Generic.IEnumerable{NHibernate.Mapping.Column})"]

Return Value

A ForeignKey for the columns in the Table.

Remarks

This does not necessarily create a ForeignKey, if one already exists for the columns then it will return an existing ForeignKey.

See Also