Table of Contents

Class AssociationModel

Namespace
LinqToDB.DataModel
Assembly
linq2db.Tools.dll

Association (e.g. foreign key relation) model. Defines whole relation (both sides).

public sealed class AssociationModel
Inheritance
AssociationModel
Extension Methods

Constructors

AssociationModel(AssociationMetadata, AssociationMetadata, EntityModel, EntityModel, bool)

public AssociationModel(AssociationMetadata sourceMetadata, AssociationMetadata tagetMetadata, EntityModel source, EntityModel target, bool manyToOne)

Parameters

sourceMetadata AssociationMetadata
tagetMetadata AssociationMetadata
source EntityModel
target EntityModel
manyToOne bool

Properties

BackreferenceExtension

Gets or sets association target (TO) extension method descriptor. When not specified - association extension method is not generated.

public MethodModel? BackreferenceExtension { get; set; }

Property Value

MethodModel

BackreferenceProperty

Gets or sets association target (TO) property descriptor on entity class. When not specified - association property is not generated on entity class.

public PropertyModel? BackreferenceProperty { get; set; }

Property Value

PropertyModel

Extension

Gets or sets association source (FROM) extension method descriptor. When not specified - association extension method is not generated.

public MethodModel? Extension { get; set; }

Property Value

MethodModel

ForeignKeyName

Get or set name of foreign key constrain for association based on foreign key.

public string? ForeignKeyName { get; set; }

Property Value

string

FromColumns

Gets or sets association source (FROM) columns, that used as association keys (usually foreign key columns). When not specified, assocation is defined using other means (SourceMetadata for details).

public ColumnModel[]? FromColumns { get; set; }

Property Value

ColumnModel[]

ManyToOne

Gets or sets flag indicating that association is many-to-one assocation, where it has collection-based type on target entity.

public bool ManyToOne { get; set; }

Property Value

bool

Property

Gets or sets association source (FROM) property descriptor on entity class. When not specified - association property is not generated on entity class.

public PropertyModel? Property { get; set; }

Property Value

PropertyModel

Source

Gets or sets association source (FROM) entity model.

public EntityModel Source { get; set; }

Property Value

EntityModel

SourceMetadata

Gets or sets association metadata for source (FROM) side or relation.

public AssociationMetadata SourceMetadata { get; set; }

Property Value

AssociationMetadata

Target

Gets or sets association target (TO) entity model.

public EntityModel Target { get; set; }

Property Value

EntityModel

TargetMetadata

Gets or sets association metadata for target (TO) side or relation.

public AssociationMetadata TargetMetadata { get; set; }

Property Value

AssociationMetadata

ToColumns

Gets or sets association target (TO) columns, that used as association keys (usually foreign key columns). When not specified, assocation is defined using other means (TargetMetadata for details).

public ColumnModel[]? ToColumns { get; set; }

Property Value

ColumnModel[]