DbContext.Entry<TEntity> Method (TEntity)

[This page is specific to the Entity Framework version 6. The latest version is available as the 'Entity Framework' NuGet package. For more information about Entity Framework, see msdn.com/data/ef.]

Gets a DbEntityEntry<TEntity> object for the given entity providing access to information about the entity and the ability to perform actions on the entity.

Namespace:  System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

Syntax

'Declaration
Public Function Entry(Of TEntity As Class) ( _
    entity As TEntity _
) As DbEntityEntry(Of TEntity)
'Usage
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.

Type Parameters

  • TEntity
    The type of the entity.

Parameters

  • entity
    Type: TEntity
    The entity.

Return Value

Type: System.Data.Entity.Infrastructure.DbEntityEntry<TEntity>
An entry for the entity.

See Also

Reference

DbContext Class

Entry Overload

System.Data.Entity Namespace