Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 2.41 KB

Database-Relationship-Config.md

File metadata and controls

50 lines (35 loc) · 2.41 KB

'Relationship' object (database-driven)

The Relationship object enables the definition of an entity framework (EF) model relationship.


Property categories

The Relationship object supports a number of properties that control the generated code output. These properties are separated into a series of logical categories.

Category Description
Key Provides the key configuration.
EF Provides the .NET Entity Framework (EF) specific configuration.
DotNet Provides the .NET configuration.

The properties with a bold name are those that are more typically used (considered more important).


Key

Provides the key configuration.

Property Description
name The name of the primary table of the query. [Mandatory]
schema The schema name of the primary table of the view.
† Defaults to CodeGeneration.Schema.
type The relationship type between the parent and child (self). Valid options are: OneToMany, ManyToOne.
† Defaults to OneToMany.
foreignKeyColumns The list of Column names from the related table that reference the parent. [Mandatory]
principalKeyColumns The list of Column names from the principal table that reference the child.
† Typically this is only used where referencing property(s) other than the primary key as the principal property(s).

EF

Provides the .NET Entity Framework (EF) specific configuration.

Property Description
onDelete The operation applied to dependent entities in the relationship when the principal is deleted or the relationship is severed. Valid options are: NoAction, Cascade, ClientCascade, ClientNoAction, ClientSetNull, Restrict, SetNull.
† Defaults to NoAction. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.deletebehavior for more information.
autoInclude Indicates whether to automatically include navigation to the property.
† Defaults to false.

DotNet

Provides the .NET configuration.

Property Description
propertyName The corresponding property name within the entity framework (EF) model.
† Defaults to Name using the CodeGeneration.AutoDotNetRename option.
efModelName The corresponding entity framework (EF) model name (.NET Type).
† Defaults to Name using the CodeGeneration.AutoDotNetRename option.