Class AssociationModel
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
AssociationMetadatatagetMetadata
AssociationMetadatasource
EntityModeltarget
EntityModelmanyToOne
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
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
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
ForeignKeyName
Get or set name of foreign key constrain for association based on foreign key.
public string? ForeignKeyName { get; set; }
Property Value
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
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
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
Source
Gets or sets association source (FROM) entity model.
public EntityModel Source { get; set; }
Property Value
SourceMetadata
Gets or sets association metadata for source (FROM) side or relation.
public AssociationMetadata SourceMetadata { get; set; }
Property Value
Target
Gets or sets association target (TO) entity model.
public EntityModel Target { get; set; }
Property Value
TargetMetadata
Gets or sets association metadata for target (TO) side or relation.
public AssociationMetadata TargetMetadata { get; set; }
Property Value
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; }