ModelExtensions.FindEntityType 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
FindEntityType(IModel, Type) |
已淘汰.
取得對應指定實體類別的實體。 |
FindEntityType(IModel, Type, String, IEntityType) |
取得指定型別的實體類型,定義導覽名稱和定義實體類型。 如果找不到相符的實體類型,則傳 |
FindEntityType(IModel, Type)
警告
Use IReadOnlyEntityType.FindEntityType
取得對應指定實體類別的實體。 null
如果找不到具有指定 CLR 類型的實體類型,或共用類型實體類型正在使用指定的 CLR 類型,或實體類型具有定義導覽,則傳回 。
public static Microsoft.EntityFrameworkCore.Metadata.IEntityType FindEntityType (this Microsoft.EntityFrameworkCore.Metadata.IModel model, Type type);
[System.Diagnostics.DebuggerStepThrough]
public static Microsoft.EntityFrameworkCore.Metadata.IEntityType FindEntityType (this Microsoft.EntityFrameworkCore.Metadata.IModel model, Type type);
[System.Diagnostics.DebuggerStepThrough]
[System.Obsolete("Use IReadOnlyEntityType.FindEntityType")]
public static Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType? FindEntityType (this Microsoft.EntityFrameworkCore.Metadata.IModel model, Type type);
static member FindEntityType : Microsoft.EntityFrameworkCore.Metadata.IModel * Type -> Microsoft.EntityFrameworkCore.Metadata.IEntityType
[<System.Diagnostics.DebuggerStepThrough>]
static member FindEntityType : Microsoft.EntityFrameworkCore.Metadata.IModel * Type -> Microsoft.EntityFrameworkCore.Metadata.IEntityType
[<System.Diagnostics.DebuggerStepThrough>]
[<System.Obsolete("Use IReadOnlyEntityType.FindEntityType")>]
static member FindEntityType : Microsoft.EntityFrameworkCore.Metadata.IModel * Type -> Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType
<Extension()>
Public Function FindEntityType (model As IModel, type As Type) As IEntityType
<Extension()>
Public Function FindEntityType (model As IModel, type As Type) As IReadOnlyEntityType
參數
- model
- IModel
要尋找實體類型的模型。
- type
- Type
要尋找對應實體類型的型別。
傳回
實體類型,如果找不到實體類型,則 null
為 。
- 屬性
適用於
FindEntityType(IModel, Type, String, IEntityType)
取得指定型別的實體類型,定義導覽名稱和定義實體類型。 如果找不到相符的實體類型,則傳 null
回 。
public static Microsoft.EntityFrameworkCore.Metadata.IEntityType FindEntityType (this Microsoft.EntityFrameworkCore.Metadata.IModel model, Type type, string definingNavigationName, Microsoft.EntityFrameworkCore.Metadata.IEntityType definingEntityType);
[System.Diagnostics.DebuggerStepThrough]
public static Microsoft.EntityFrameworkCore.Metadata.IEntityType FindEntityType (this Microsoft.EntityFrameworkCore.Metadata.IModel model, Type type, string definingNavigationName, Microsoft.EntityFrameworkCore.Metadata.IEntityType definingEntityType);
static member FindEntityType : Microsoft.EntityFrameworkCore.Metadata.IModel * Type * string * Microsoft.EntityFrameworkCore.Metadata.IEntityType -> Microsoft.EntityFrameworkCore.Metadata.IEntityType
[<System.Diagnostics.DebuggerStepThrough>]
static member FindEntityType : Microsoft.EntityFrameworkCore.Metadata.IModel * Type * string * Microsoft.EntityFrameworkCore.Metadata.IEntityType -> Microsoft.EntityFrameworkCore.Metadata.IEntityType
<Extension()>
Public Function FindEntityType (model As IModel, type As Type, definingNavigationName As String, definingEntityType As IEntityType) As IEntityType
參數
- model
- IModel
要尋找實體類型的模型。
- type
- Type
要尋找的實體類型類型。
- definingNavigationName
- String
要尋找之實體類型的定義導覽。
- definingEntityType
- IEntityType
要尋找之實體類型的定義實體類型。
傳回
實體類型,如果找不到實體類型,則 null
為 。
- 屬性