IMutableModel.AddOwnedEntityType 方法

定義

多載

AddOwnedEntityType(String)

將預設類型的擁有實體類型新增至模型。

AddOwnedEntityType(Type)

將擁有的實體類型新增至模型。

AddOwnedEntityType(String, Type)

將擁有的共用類型實體類型新增至模型。

AddOwnedEntityType(String)

將預設類型的擁有實體類型新增至模型。

public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddOwnedEntityType (string name);
abstract member AddOwnedEntityType : string -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddOwnedEntityType (name As String) As IMutableEntityType

參數

name
String

要加入之實體的名稱。

傳回

新的實體類型。

備註

在執行時間搭配 DbContext 使用的模型中,目前不支援陰影實體。 因此,陰影狀態實體類型只會存在於移轉模型快照集等中。

適用於

AddOwnedEntityType(Type)

將擁有的實體類型新增至模型。

public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddOwnedEntityType (Type type);
abstract member AddOwnedEntityType : Type -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddOwnedEntityType (type As Type) As IMutableEntityType

參數

type
Type

用來表示實體類型實例的 CLR 類別。

傳回

新的實體類型。

適用於

AddOwnedEntityType(String, Type)

將擁有的共用類型實體類型新增至模型。

public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddOwnedEntityType (string name, Type type);
abstract member AddOwnedEntityType : string * Type -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddOwnedEntityType (name As String, type As Type) As IMutableEntityType

參數

name
String

要加入之實體的名稱。

type
Type

用來表示實體類型實例的 CLR 類別。

傳回

新的實體類型。

備註

共用類型實體類型是實體類型,可以與模型中的其他類型共用 CLR 類型,但具有唯一的名稱,且一律由名稱識別。

適用於