IMutableModel.AddEntityType 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddEntityType(String) |
將預設類型的實體類型新增至模型。 |
AddEntityType(String, Type) |
將共用類型實體類型新增至模型。 |
AddEntityType(Type) |
將實體類型加入模型。 |
AddEntityType(String, String, IMutableEntityType) |
將具有定義導覽的擁有實體類型新增至模型。 |
AddEntityType(Type, String, IMutableEntityType) |
將具有定義導覽的擁有實體類型新增至模型。 |
AddEntityType(String)
將預設類型的實體類型新增至模型。
public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddEntityType (string name);
abstract member AddEntityType : string -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddEntityType (name As String) As IMutableEntityType
參數
- name
- String
要加入的機構名稱。
傳回
新的實體類型。
備註
在運行 DbContext 時間搭配 使用的模型中,目前不支援陰影實體。 因此,陰影狀態實體類型只會存在於移轉模型快照集等中。
適用於
AddEntityType(String, Type)
將共用類型實體類型新增至模型。
public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddEntityType (string name, Type type);
abstract member AddEntityType : string * Type -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddEntityType (name As String, type As Type) As IMutableEntityType
參數
- name
- String
要加入的機構名稱。
- type
- Type
用來表示實體型別實例的 CLR 類別。
傳回
新的實體類型。
備註
共用類型實體類型是實體類型,可以與模型中的其他類型共用 CLR 類型,但具有唯一的名稱,且一律由名稱識別。
適用於
AddEntityType(Type)
將實體類型加入模型。
public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddEntityType (Type clrType);
public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddEntityType (Type type);
abstract member AddEntityType : Type -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
abstract member AddEntityType : Type -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddEntityType (clrType As Type) As IMutableEntityType
Public Function AddEntityType (type As Type) As IMutableEntityType
參數
- clrTypetype
- Type
用來表示實體型別實例的 CLR 類別。
傳回
新的實體類型。
適用於
AddEntityType(String, String, IMutableEntityType)
將具有定義導覽的擁有實體類型新增至模型。
public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddEntityType (string name, string definingNavigationName, Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType definingEntityType);
abstract member AddEntityType : string * string * Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddEntityType (name As String, definingNavigationName As String, definingEntityType As IMutableEntityType) As IMutableEntityType
參數
- name
- String
要加入的實體類型名稱。
- definingNavigationName
- String
定義導覽。
- definingEntityType
- IMutableEntityType
定義實體類型。
傳回
新的實體類型。
適用於
AddEntityType(Type, String, IMutableEntityType)
將具有定義導覽的擁有實體類型新增至模型。
public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddEntityType (Type clrType, string definingNavigationName, Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType definingEntityType);
public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddEntityType (Type type, string definingNavigationName, Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType definingEntityType);
abstract member AddEntityType : Type * string * Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
abstract member AddEntityType : Type * string * Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddEntityType (clrType As Type, definingNavigationName As String, definingEntityType As IMutableEntityType) As IMutableEntityType
Public Function AddEntityType (type As Type, definingNavigationName As String, definingEntityType As IMutableEntityType) As IMutableEntityType
參數
- clrTypetype
- Type
用來表示此實體類型的實例的 CLR 類別。
- definingNavigationName
- String
定義導覽。
- definingEntityType
- IMutableEntityType
定義實體類型。
傳回
新的實體類型。