ForeignKeyAttribute constructor (1 of 5)

namespace: Serenity.Data.Mapping   assemblySerenity.Net.Data

Specifies that this property is a foreign key to another field in a primary key table.

public ForeignKeyAttribute(Type rowType)
parameter description
rowType Entity for primary key table.

See Also


ForeignKeyAttribute constructor (2 of 5)

namespace: Serenity.Data.Mapping   assemblySerenity.Net.Data

Specifies that this property is a foreign key to another field in a primary key table.

public ForeignKeyAttribute(string table, string field)
parameter description
table Primary key table
field Matching column in primary key table

See Also


ForeignKeyAttribute constructor (3 of 5)

namespace: Serenity.Data.Mapping   assemblySerenity.Net.Data

Specifies that this property is a foreign key to another field in a primary key table.

public ForeignKeyAttribute(Type rowType, string field)
parameter description
rowType Entity for primary key table. Row must have a [TableName] attribute.
field If field parameter is not specified, the row type must have a field with [Identity] attribute or single property with [PrimaryKey] attribute. (implementing IIdRow won't help)

See Also


ForeignKeyAttribute constructor (4 of 5)

namespace: Serenity.Data.Mapping   assemblySerenity.Net.Data

Specifies that this property is a foreign key to another field in a primary key table.

public ForeignKeyAttribute(string table, string field, params ServerType[] serverTypes)
parameter description
table Primary key table
field Matching column in primary key table
serverTypes Dialects like MySql, Sqlite.

See Also


ForeignKeyAttribute constructor (5 of 5)

namespace: Serenity.Data.Mapping   assemblySerenity.Net.Data

Specifies that this property is a foreign key to another field in a primary key table.

public ForeignKeyAttribute(Type rowType, string field, params ServerType[] serverTypes)
parameter description
rowType Entity for primary key table. Row must have a [TableName] attribute.
field If field parameter is not specified, the row type must have a field with [Identity] attribute or single property with [PrimaryKey] attribute. (implementing IIdRow won't help)
serverTypes Dialects like MySql, Sqlite.

See Also