Entity Framework - SPLessons

Entity Framework DBEntityEntry Class

Home > Lesson > Chapter 10
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

Entity Framework DBEntityEntry Class

Entity Framework DBEntityEntry Class

DBEntityEntry Class

shape Description

DBEntityEntry Class is used to retrieve the information about the entities. DBContext Entry method is used to get the instance of the particular entity.

shape Example

DBEntityEntry EmpEntry=dbcontext.Entry(EmpEntry); By using DBEntityEntry Class,one can access Entity state, current and original values of all the properties.

Methods of DBEntityEntry Class

shape Methods

Method Name Return Type Description
Collection DBCollectionEntry Gets an object that represents the collection navigation property from this entity to collection of related entities.
ComplexProperty DBComplexPropertyEntry Gets an object that represents a complex property of this entity.
GetDatabaseValues DBPropertyValues Queries the database for copies of the values of the tracked entity as they currently exist in the database.Changing the values in the returned dictionary will not update the values in the database.
Property DBProperyEntry Gets an object that represents a scalar or complex property of this entity.
Reference DBReferenceEntry Gets an object that represents the reference navigation property from this entity to another entity.