語言

ReferenceOwnershipBuilder<TEntity,TRelatedEntity>.OwnsMany 方法

定義

多載

名稱 Description
OwnsMany<TDependentEntity>(Expression<Func<TRelatedEntity,IEnumerable<TDependentEntity>>>)

配置一個關係,使目標實體由該實體擁有(或其一部分)。

即使導覽屬於同一類型,每個所有權關係的目標實體類型仍被視為不同的實體類型。 目標實體類型的設定不會套用到其他所有權關係的目標實體類型。

大多數對擁有實體的操作都需要透過擁有者實體使用相應的導航系統存取。

OwnsMany<TDependentEntity>(String)

配置一個關係,使目標實體由該實體擁有(或其一部分)。

即使導覽屬於同一類型,每個所有權關係的目標實體類型仍被視為不同的實體類型。 目標實體類型的設定不會套用到其他所有權關係的目標實體類型。

大多數對擁有實體的操作都需要透過擁有者實體使用相應的導航系統存取。

OwnsMany<TDependentEntity>(Expression<Func<TRelatedEntity,IEnumerable<TDependentEntity>>>, Action<CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>>)

配置一個關係,使目標實體由該實體擁有(或其一部分)。

即使導覽屬於同一類型,每個所有權關係的目標實體類型仍被視為不同的實體類型。 目標實體類型的設定不會套用到其他所有權關係的目標實體類型。

大多數對擁有實體的操作都需要透過擁有者實體使用相應的導航系統存取。

OwnsMany<TDependentEntity>(String, Action<CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>>)

配置一個關係,使目標實體由該實體擁有(或其一部分)。

即使導覽屬於同一類型,每個所有權關係的目標實體類型仍被視為不同的實體類型。 目標實體類型的設定不會套用到其他所有權關係的目標實體類型。

大多數對擁有實體的操作都需要透過擁有者實體使用相應的導航系統存取。

OwnsMany<TDependentEntity>(Expression<Func<TRelatedEntity,IEnumerable<TDependentEntity>>>)

來源:
ReferenceOwnershipBuilder`.cs

配置一個關係,使目標實體由該實體擁有(或其一部分)。

即使導覽屬於同一類型,每個所有權關係的目標實體類型仍被視為不同的實體類型。 目標實體類型的設定不會套用到其他所有權關係的目標實體類型。

大多數對擁有實體的操作都需要透過擁有者實體使用相應的導航系統存取。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity> OwnsMany<TDependentEntity>(System.Linq.Expressions.Expression<Func<TRelatedEntity,System.Collections.Generic.IEnumerable<TDependentEntity>>> navigationExpression) where TDependentEntity : class;
override this.OwnsMany : System.Linq.Expressions.Expression<Func<'RelatedEntity, seq<'DependentEntity>>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<'RelatedEntity, 'DependentEntity (requires 'RelatedEntity : null and 'DependentEntity : null)> (requires 'DependentEntity : null)
Public Overridable Function OwnsMany(Of TDependentEntity As Class) (navigationExpression As Expression(Of Func(Of TRelatedEntity, IEnumerable(Of TDependentEntity)))) As CollectionOwnershipBuilder(Of TRelatedEntity, TDependentEntity)

類型參數

TDependentEntity

這個關係所針對的實體類型。

參數

navigationExpression
Expression<Func<TRelatedEntity,IEnumerable<TDependentEntity>>>

一個 lambda 表達式,代表此實體型別的參考導航屬性,代表關係(customer => customer.Address)。

傳回

CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>

一個可以用來設定擁有型態與關係的物件。

適用於

OwnsMany<TDependentEntity>(String)

來源:
ReferenceOwnershipBuilder`.cs

配置一個關係,使目標實體由該實體擁有(或其一部分)。

即使導覽屬於同一類型,每個所有權關係的目標實體類型仍被視為不同的實體類型。 目標實體類型的設定不會套用到其他所有權關係的目標實體類型。

大多數對擁有實體的操作都需要透過擁有者實體使用相應的導航系統存取。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity> OwnsMany<TDependentEntity>(string navigationName) where TDependentEntity : class;
override this.OwnsMany : string -> Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<'RelatedEntity, 'DependentEntity (requires 'RelatedEntity : null and 'DependentEntity : null)> (requires 'DependentEntity : null)
Public Overridable Function OwnsMany(Of TDependentEntity As Class) (navigationName As String) As CollectionOwnershipBuilder(Of TRelatedEntity, TDependentEntity)

類型參數

TDependentEntity

這個關係所針對的實體類型。

參數

navigationName
String

此實體類型中代表關係的參考導航屬性名稱。

傳回

CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>

一個可以用來設定擁有型態與關係的物件。

適用於

OwnsMany<TDependentEntity>(Expression<Func<TRelatedEntity,IEnumerable<TDependentEntity>>>, Action<CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>>)

來源:
ReferenceOwnershipBuilder`.cs

配置一個關係,使目標實體由該實體擁有(或其一部分)。

即使導覽屬於同一類型,每個所有權關係的目標實體類型仍被視為不同的實體類型。 目標實體類型的設定不會套用到其他所有權關係的目標實體類型。

大多數對擁有實體的操作都需要透過擁有者實體使用相應的導航系統存取。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder<TEntity,TRelatedEntity> OwnsMany<TDependentEntity>(System.Linq.Expressions.Expression<Func<TRelatedEntity,System.Collections.Generic.IEnumerable<TDependentEntity>>> navigationExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>> buildAction) where TDependentEntity : class;
override this.OwnsMany : System.Linq.Expressions.Expression<Func<'RelatedEntity, seq<'DependentEntity>>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<'RelatedEntity, 'DependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder<'Entity, 'RelatedEntity (requires 'Entity : null and 'RelatedEntity : null)> (requires 'DependentEntity : null)
Public Overridable Function OwnsMany(Of TDependentEntity As Class) (navigationExpression As Expression(Of Func(Of TRelatedEntity, IEnumerable(Of TDependentEntity))), buildAction As Action(Of CollectionOwnershipBuilder(Of TRelatedEntity, TDependentEntity))) As ReferenceOwnershipBuilder(Of TEntity, TRelatedEntity)

類型參數

TDependentEntity

這個關係所針對的實體類型。

參數

navigationExpression
Expression<Func<TRelatedEntity,IEnumerable<TDependentEntity>>>

一個 lambda 表達式,代表此實體型別的參考導航屬性,代表關係(customer => customer.Address)。

buildAction
Action<CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>>

一個負責設定擁有型態及關係的動作。

傳回

一個可以用來設定實體類型的物件。

適用於

OwnsMany<TDependentEntity>(String, Action<CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>>)

來源:
ReferenceOwnershipBuilder`.cs

配置一個關係,使目標實體由該實體擁有(或其一部分)。

即使導覽屬於同一類型,每個所有權關係的目標實體類型仍被視為不同的實體類型。 目標實體類型的設定不會套用到其他所有權關係的目標實體類型。

大多數對擁有實體的操作都需要透過擁有者實體使用相應的導航系統存取。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder<TEntity,TRelatedEntity> OwnsMany<TDependentEntity>(string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>> buildAction) where TDependentEntity : class;
override this.OwnsMany : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<'RelatedEntity, 'DependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder<'Entity, 'RelatedEntity (requires 'Entity : null and 'RelatedEntity : null)> (requires 'DependentEntity : null)
Public Overridable Function OwnsMany(Of TDependentEntity As Class) (navigationName As String, buildAction As Action(Of CollectionOwnershipBuilder(Of TRelatedEntity, TDependentEntity))) As ReferenceOwnershipBuilder(Of TEntity, TRelatedEntity)

類型參數

TDependentEntity

這個關係所針對的實體類型。

參數

navigationName
String

此實體類型中代表關係的參考導航屬性名稱。

buildAction
Action<CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>>

一個負責設定擁有型態及關係的動作。

傳回

一個可以用來設定實體類型的物件。

適用於