Object Services enable you to work with entities such as memory objects. It strives to eliminate the impedance mismatch that exists between the relational or logical and the programming models. You can use Object Services for change tracking, data binding objects to data controls, and handling concurrency conflicts. Object Services support both LINQ and Entity SQL queries. The classes of the Object Services Layer is contained is the System.Data.Objects and System.Data.Objects.DataClasses namespaces. The ObjectContext is the core of the Object Services Layer.
The ObjectContext
class encapsulates the following:
An
EntityConnection
instanceA
MetadataWorkspace
instanceAn instance of
ObjectStateManager
While the EntityConnection
instance is responsible for connecting to the database, the instance of MetadataWorkspace
contains the metadata information that describes the entity data model. The ObjectContext
class also encapsulates an ObjectStateManager
instance that enables...