IModel.FindRuntimeEntityType(Type) 方法

定义

获取映射给定实体类的实体,其中类可能是派生自实际实体类型的代理。 null如果未找到具有给定 CLR 类型的实体类型,或者共享类型实体类型正在使用给定 CLR 类型,或者实体类型具有定义导航,则返回 。

public virtual Microsoft.EntityFrameworkCore.Metadata.IEntityType? FindRuntimeEntityType (Type type);
public virtual Microsoft.EntityFrameworkCore.Metadata.IEntityType? FindRuntimeEntityType (Type? type);
abstract member FindRuntimeEntityType : Type -> Microsoft.EntityFrameworkCore.Metadata.IEntityType
override this.FindRuntimeEntityType : Type -> Microsoft.EntityFrameworkCore.Metadata.IEntityType
Public Overridable Function FindRuntimeEntityType (type As Type) As IEntityType

参数

type
Type

要为其查找相应实体类型的类型。

返回

实体类型;如果未找到实体类型, null 则为 。

注解

有关详细信息和示例,请参阅 为实体类型和关系建模

适用于