OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.OwnsMany 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
OwnsMany(String, String, Action<OwnedNavigationBuilder>)
設定關聯性,其中目標實體是由 (或) 此實體的一部分所擁有。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsMany (string ownedTypeName, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsMany (string ownedTypeName, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
override this.OwnsMany : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)>
override this.OwnsMany : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)>
Public Overridable Function OwnsMany (ownedTypeName As String, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsMany (ownedTypeName As String, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)
參數
- ownedTypeName
- String
此關聯性目標實體類型的名稱。
- navigationName
- String
此實體類型上代表關聯性的參考導覽屬性名稱。
- buildAction
- Action<OwnedNavigationBuilder>
執行擁有型別和關聯性組態的動作。
傳回
物件,可用來設定實體類型。
備註
每個擁有權關聯性的目標實體類型都會被視為不同的實體類型,即使導覽的類型相同也一樣。 目標實體類型的設定不會套用至其他擁有權關聯性的目標實體類型。
擁有實體上的大部分作業都需要使用對應的導覽,透過擁有者實體存取它。
呼叫此方法之後,您應該鏈結對 的 WithOwner 呼叫,以完整設定關聯性。
適用於
OwnsMany(Type, String, Action<OwnedNavigationBuilder>)
設定關聯性,其中目標實體是由 (或) 此實體的一部分所擁有。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsMany (Type ownedType, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsMany (Type ownedType, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
override this.OwnsMany : Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)>
override this.OwnsMany : Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)>
Public Overridable Function OwnsMany (ownedType As Type, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsMany (ownedType As Type, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)
參數
- ownedType
- Type
此關聯性的目標實體類型。
- navigationName
- String
此實體類型上代表關聯性的參考導覽屬性名稱。
- buildAction
- Action<OwnedNavigationBuilder>
執行擁有型別和關聯性組態的動作。
傳回
物件,可用來設定實體類型。
備註
每個擁有權關聯性的目標實體類型都會被視為不同的實體類型,即使導覽的類型相同也一樣。 目標實體類型的設定不會套用至其他擁有權關聯性的目標實體類型。
擁有實體上的大部分作業都需要使用對應的導覽,透過擁有者實體存取它。
呼叫此方法之後,您應該鏈結對 的 WithOwner 呼叫,以完整設定關聯性。
適用於
OwnsMany(String, Type, String, Action<OwnedNavigationBuilder>)
設定關聯性,其中目標實體是由 (或) 此實體的一部分所擁有。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsMany (string ownedTypeName, Type ownedType, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsMany (string ownedTypeName, Type ownedType, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
override this.OwnsMany : string * Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)>
override this.OwnsMany : string * Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)>
Public Overridable Function OwnsMany (ownedTypeName As String, ownedType As Type, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsMany (ownedTypeName As String, ownedType As Type, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)
參數
- ownedTypeName
- String
此關聯性目標實體類型的名稱。
- ownedType
- Type
此關聯性目標實體類型的 CLR 類型。
- navigationName
- String
此實體類型上代表關聯性的參考導覽屬性名稱。
- buildAction
- Action<OwnedNavigationBuilder>
執行擁有型別和關聯性組態的動作。
傳回
物件,可用來設定實體類型。
備註
每個擁有權關聯性的目標實體類型都會被視為不同的實體類型,即使導覽的類型相同也一樣。 目標實體類型的設定不會套用至其他擁有權關聯性的目標實體類型。
擁有實體上的大部分作業都需要使用對應的導覽,透過擁有者實體存取它。
呼叫此方法之後,您應該鏈結對 的 WithOwner 呼叫,以完整設定關聯性。
適用於
OwnsMany<TNewDependentEntity>(String, String, Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>)
設定關聯性,其中目標實體是由 (或) 此實體的一部分所擁有。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsMany<TNewDependentEntity> (string ownedTypeName, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsMany<TNewDependentEntity> (string ownedTypeName, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
override this.OwnsMany : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
override this.OwnsMany : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)
類型參數
- TNewDependentEntity
此關聯性的目標實體類型。
參數
- ownedTypeName
- String
此關聯性目標實體類型的名稱。
- navigationName
- String
此實體類型上代表關聯性的參考導覽屬性名稱。
- buildAction
- Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>
執行擁有型別和關聯性組態的動作。
傳回
物件,可用來設定實體類型。
備註
每個擁有權關聯性的目標實體類型都會被視為不同的實體類型,即使導覽的類型相同也一樣。 目標實體類型的設定不會套用至其他擁有權關聯性的目標實體類型。
擁有實體上的大部分作業都需要使用對應的導覽,透過擁有者實體存取它。
呼叫此方法之後,您應該鏈結對 的 WithOwner 呼叫,以完整設定關聯性。
適用於
OwnsMany<TNewDependentEntity>(String, Expression<Func<TDependentEntity, IEnumerable<TNewDependentEntity>>>, Action<OwnedNavigationBuilder<TDependentEntity, TNewDependentEntity>>)
設定關聯性,其中目標實體是由 (或) 此實體的一部分所擁有。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsMany<TNewDependentEntity> (string ownedTypeName, System.Linq.Expressions.Expression<Func<TDependentEntity,System.Collections.Generic.IEnumerable<TNewDependentEntity>>> navigationExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsMany<TNewDependentEntity> (string ownedTypeName, System.Linq.Expressions.Expression<Func<TDependentEntity,System.Collections.Generic.IEnumerable<TNewDependentEntity>?>> navigationExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
override this.OwnsMany : string * System.Linq.Expressions.Expression<Func<'DependentEntity, seq<'NewDependentEntity>>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
override this.OwnsMany : string * System.Linq.Expressions.Expression<Func<'DependentEntity, seq<'NewDependentEntity>>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationExpression As Expression(Of Func(Of TDependentEntity, IEnumerable(Of TNewDependentEntity))), buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationExpression As Expression(Of Func(Of TDependentEntity, IEnumerable(Of TNewDependentEntity))), buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)
類型參數
- TNewDependentEntity
此關聯性的目標實體類型。
參數
- ownedTypeName
- String
此關聯性目標實體類型的名稱。
- navigationExpression
- Expression<Func<TDependentEntity,IEnumerable<TNewDependentEntity>>>
Lambda 運算式,表示這個實體類型上的參考導覽屬性,表示關聯性 () customer => customer.Address
。
- buildAction
- Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>
執行擁有型別和關聯性組態的動作。
傳回
物件,可用來設定實體類型。
備註
每個擁有權關聯性的目標實體類型都會被視為不同的實體類型,即使導覽的類型相同也一樣。 目標實體類型的設定不會套用至其他擁有權關聯性的目標實體類型。
擁有實體上的大部分作業都需要使用對應的導覽,透過擁有者實體存取它。
呼叫此方法之後,您應該鏈結對 的 WithOwner 呼叫,以完整設定關聯性。
適用於
OwnsMany<TNewDependentEntity>(String, String)
設定關聯性,其中目標實體是由 (或) 此實體的一部分所擁有。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsMany<TNewDependentEntity> (string ownedTypeName, string navigationName) where TNewDependentEntity : class;
override this.OwnsMany : string * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity (requires 'DependentEntity : null and 'NewDependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationName As String) As OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity)
類型參數
- TNewDependentEntity
此關聯性的目標實體類型。
參數
- ownedTypeName
- String
此關聯性目標實體類型的名稱。
- navigationName
- String
此實體類型上代表關聯性的參考導覽屬性名稱。
傳回
物件,可用來設定擁有的類型和關聯性。
備註
每個擁有權關聯性的目標實體類型都會被視為不同的實體類型,即使導覽的類型相同也一樣。 目標實體類型的設定不會套用至其他擁有權關聯性的目標實體類型。
擁有實體上的大部分作業都需要使用對應的導覽,透過擁有者實體存取它。
呼叫此方法之後,您應該鏈結對 的 WithOwner 呼叫,以完整設定關聯性。
適用於
OwnsMany<TNewDependentEntity>(String, Expression<Func<TDependentEntity,IEnumerable<TNewDependentEntity>>>)
設定關聯性,其中目標實體是由 (或) 此實體的一部分所擁有。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsMany<TNewDependentEntity> (string ownedTypeName, System.Linq.Expressions.Expression<Func<TDependentEntity,System.Collections.Generic.IEnumerable<TNewDependentEntity>>> navigationExpression) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsMany<TNewDependentEntity> (string ownedTypeName, System.Linq.Expressions.Expression<Func<TDependentEntity,System.Collections.Generic.IEnumerable<TNewDependentEntity>?>> navigationExpression) where TNewDependentEntity : class;
override this.OwnsMany : string * System.Linq.Expressions.Expression<Func<'DependentEntity, seq<'NewDependentEntity>>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity (requires 'DependentEntity : null and 'NewDependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationExpression As Expression(Of Func(Of TDependentEntity, IEnumerable(Of TNewDependentEntity)))) As OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity)
類型參數
- TNewDependentEntity
此關聯性的目標實體類型。
參數
- ownedTypeName
- String
此關聯性目標實體類型的名稱。
- navigationExpression
- Expression<Func<TDependentEntity,IEnumerable<TNewDependentEntity>>>
Lambda 運算式,表示這個實體類型上的參考導覽屬性,表示關聯性 () customer => customer.Address
。
傳回
物件,可用來設定擁有的類型和關聯性。
備註
每個擁有權關聯性的目標實體類型都會被視為不同的實體類型,即使導覽的類型相同也一樣。 目標實體類型的設定不會套用至其他擁有權關聯性的目標實體類型。
擁有實體上的大部分作業都需要使用對應的導覽,透過擁有者實體存取它。
呼叫此方法之後,您應該鏈結對 的 WithOwner 呼叫,以完整設定關聯性。
適用於
OwnsMany<TNewDependentEntity>(String)
設定關聯性,其中目標實體是由 (或) 此實體的一部分所擁有。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsMany<TNewDependentEntity> (string navigationName) where TNewDependentEntity : class;
override this.OwnsMany : string -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity (requires 'DependentEntity : null and 'NewDependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (navigationName As String) As OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity)
類型參數
- TNewDependentEntity
此關聯性的目標實體類型。
參數
- navigationName
- String
此實體類型上代表關聯性的參考導覽屬性名稱。
傳回
物件,可用來設定擁有的類型和關聯性。
備註
每個擁有權關聯性的目標實體類型都會被視為不同的實體類型,即使導覽的類型相同也一樣。 目標實體類型的設定不會套用至其他擁有權關聯性的目標實體類型。
擁有實體上的大部分作業都需要使用對應的導覽,透過擁有者實體存取它。
呼叫此方法之後,您應該鏈結對 的 WithOwner 呼叫,以完整設定關聯性。
適用於
OwnsMany<TNewDependentEntity>(Expression<Func<TDependentEntity, IEnumerable<TNewDependentEntity>>>, Action<OwnedNavigationBuilder<TDependentEntity, TNewDependentEntity>>)
設定目標實體由 (或) 此實體的一部分所擁有的關聯性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsMany<TNewDependentEntity> (System.Linq.Expressions.Expression<Func<TDependentEntity,System.Collections.Generic.IEnumerable<TNewDependentEntity>>> navigationExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsMany<TNewDependentEntity> (System.Linq.Expressions.Expression<Func<TDependentEntity,System.Collections.Generic.IEnumerable<TNewDependentEntity>?>> navigationExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
override this.OwnsMany : System.Linq.Expressions.Expression<Func<'DependentEntity, seq<'NewDependentEntity>>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
override this.OwnsMany : System.Linq.Expressions.Expression<Func<'DependentEntity, seq<'NewDependentEntity>>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (navigationExpression As Expression(Of Func(Of TDependentEntity, IEnumerable(Of TNewDependentEntity))), buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (navigationExpression As Expression(Of Func(Of TDependentEntity, IEnumerable(Of TNewDependentEntity))), buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)
類型參數
- TNewDependentEntity
這個關聯性的目標實體類型。
參數
- navigationExpression
- Expression<Func<TDependentEntity,IEnumerable<TNewDependentEntity>>>
Lambda 運算式,表示這個實體類型上的參考導覽屬性,表示關聯性 () customer => customer.Address
。
- buildAction
- Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>
執行擁有型別和關聯性組態的動作。
傳回
可用來設定實體類型的 物件。
備註
每個擁有權關聯性的目標實體類型都會被視為不同的實體類型,即使導覽的類型相同也一樣。 目標實體類型的設定不會套用至其他擁有權關聯性的目標實體類型。
擁有實體上的大部分作業都需要使用對應的導覽,透過擁有者實體存取它。
呼叫這個方法之後,您應該鏈結對 WithOwner 的呼叫,以完整設定關聯性。
適用於
OwnsMany<TNewDependentEntity>(Expression<Func<TDependentEntity,IEnumerable<TNewDependentEntity>>>)
設定目標實體由 (或) 此實體的一部分所擁有的關聯性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsMany<TNewDependentEntity> (System.Linq.Expressions.Expression<Func<TDependentEntity,System.Collections.Generic.IEnumerable<TNewDependentEntity>>> navigationExpression) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsMany<TNewDependentEntity> (System.Linq.Expressions.Expression<Func<TDependentEntity,System.Collections.Generic.IEnumerable<TNewDependentEntity>?>> navigationExpression) where TNewDependentEntity : class;
override this.OwnsMany : System.Linq.Expressions.Expression<Func<'DependentEntity, seq<'NewDependentEntity>>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity (requires 'DependentEntity : null and 'NewDependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (navigationExpression As Expression(Of Func(Of TDependentEntity, IEnumerable(Of TNewDependentEntity)))) As OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity)
類型參數
- TNewDependentEntity
這個關聯性的目標實體類型。
參數
- navigationExpression
- Expression<Func<TDependentEntity,IEnumerable<TNewDependentEntity>>>
Lambda 運算式,表示這個實體類型上的參考導覽屬性,表示關聯性 (customer => customer.Address
) 。
傳回
物件,可用來設定擁有的類型和關聯性。
備註
即使導覽的類型相同,每個擁有權關聯性的目標實體類型都會被視為不同的實體類型。 目標實體類型的設定不會套用至其他擁有權關聯性的目標實體類型。
擁有實體上的大部分作業都需要使用對應的導覽,透過擁有者實體存取它。
呼叫這個方法之後,您應該鏈結對 WithOwner 的呼叫,以完整設定關聯性。
適用於
OwnsMany<TNewDependentEntity>(String, Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>)
設定目標實體由 (或) 此實體的一部分所擁有的關聯性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsMany<TNewDependentEntity> (string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsMany<TNewDependentEntity> (string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
override this.OwnsMany : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
override this.OwnsMany : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (navigationName As String, buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (navigationName As String, buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)
類型參數
- TNewDependentEntity
這個關聯性的目標實體類型。
參數
- navigationName
- String
此實體類型上代表關聯性的參考導覽屬性名稱。
- buildAction
- Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>
執行擁有類型和關聯性組態的動作。
傳回
可用來設定實體類型的 物件。
備註
即使導覽的類型相同,每個擁有權關聯性的目標實體類型都會被視為不同的實體類型。 目標實體類型的設定不會套用至其他擁有權關聯性的目標實體類型。
擁有實體上的大部分作業都需要使用對應的導覽,透過擁有者實體存取它。
呼叫這個方法之後,您應該鏈結對 WithOwner 的呼叫,以完整設定關聯性。