DbEntityEntry.Cast<TEntity> 方法

定义

返回此 对象表示的 DbEntityEntry<TEntity> 跟踪实体的给定泛型类型的泛型类的新实例。 请注意,跟踪实体的类型必须与泛型类型兼容,否则将引发异常。

public System.Data.Entity.Infrastructure.DbEntityEntry<TEntity> Cast<TEntity>() where TEntity : class;
member this.Cast : unit -> System.Data.Entity.Infrastructure.DbEntityEntry<'Entity (requires 'Entity : null)> (requires 'Entity : null)
Public Function Cast(Of TEntity As Class) () As DbEntityEntry(Of TEntity)

类型参数

TEntity

实体的类型。

返回

泛型版本。

适用于