DbContext.Entry<TEntity> 方法 (TEntity)
[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]
获取给定实体的 DbEntityEntry<TEntity> 对象,以便提供对与该实体有关的信息的访问以及对实体执行操作的功能。
命名空间: System.Data.Entity
程序集: EntityFramework(在 EntityFramework.dll 中)
语法
声明
Public Function Entry(Of TEntity As Class) ( _
entity As TEntity _
) As DbEntityEntry(Of TEntity)
用法
Dim instance As DbContext
Dim entity As TEntity
Dim returnValue As DbEntityEntry(Of TEntity)
returnValue = instance.Entry(entity)
public DbEntityEntry<TEntity> Entry<TEntity>(
TEntity entity
)
where TEntity : class
public:
generic<typename TEntity>
where TEntity : ref class
DbEntityEntry<TEntity>^ Entry(
TEntity entity
)
member Entry :
entity:'TEntity -> DbEntityEntry<'TEntity> when 'TEntity : not struct
JScript does not support generic types and methods.
类型参数
- TEntity
实体的类型。
参数
- entity
类型:TEntity
实体。
返回值
类型:System.Data.Entity.Infrastructure.DbEntityEntry<TEntity>
实体的项。