The preceding three chapters about Entity Framework (EF) and the Entity Data Model (EDM) deal primarily with mapping from the store to the conceptual schema and querying the EDM with Entity SQL (eSQL) and LINQ to Entities. This chapter primarily addresses create, update, and delete (CUD) operations on entity instances and collections, including optimistic concurrency management. It also covers the process of detaching entities from an existing
ObjectContext instance and attaching them to new
ObjectContext instances, which is an important factor in the use of the EDM as a data source in n-tier, service-oriented applications.
The chapter also deals with mapping and updating complex types, which also are known as value objects. Complex types are data structures, which resemble entities that have multiple properties but don't have a unique identity. The most common example of a complex type is
Address, which might have
StreetAddress, City, Region, PostalCode, and
Sample projects for this chapter are in the \WROX\ADONET\Chapter13\CS and ... \VB folders.
Chapter 9's "ObjectStateManager" section introduced you to EF's
ObjectStateManager, which is responsible for managing entity instances' identity, providing change tracking, and supplying a change set that you can use for resolving concurrency conflicts. Chapter 9's primary context is an overview ...