AdventureWorks Complete Model (EDM)
Many applications that are based on the Entity Data Model (EDM) require mapping schemas to a database that is already in use. Mapping to existing data is more complex than implementing the storage model after the conceptual design is finished.
The AdventureWorks database that is included with SQL Server is a large, normalized database designed to demonstrate the features of SQL Server. There are five subsections of the AdventureWorks database, all of which can be specified in a single EntityContainer using conceptual schema definition language (CSDL). The storage model is described by metadata in store schema definition language (SSDL). Mapping between conceptual and storage schemas is done in mapping specification language (MSL).
New data types introduced in SQL Server 2008 are not supported explicitly by this version of the Entity Framework. These data types include the following: hierarchyid, geography, and filestream. Because the AdventureWorks 2008 database features these new data types, errors occur when generating a data model that is based on the AdventureWorks 2008 database. For more information, see the Microsoft SQL Server Product Samples: Database page on the CodePlex Web site.
All the schemas in the following topics were generated by the command line tool EdmGen.exe. The syntax of the single command used includes the /FullGeneration and /Project:AdventureWorks, /Provider switches, and a connection string to the AdventureWorks database.
"%windir%\Microsoft.NET\Framework\v3.5\edmgen.exe" /mode:fullgeneration /project:AdventureWorks /provider:System.Data.SqlClient /connectionstring:"server=localhost; integrated security=true; database=AdventureWorks" /outssdl:AdventureWorks.ssdl /outcsdl:AdventureWorks.csdl /outmsl:AdventureWorks.msl /outViews:AdventureWorks.Views.cs /outObjectLayer:AdventureWorks.ObjectLayer.cs
For 64-bit systems, EdmGen.exe is located in C:\windows\Microsoft.NET\Framework64\v3.5.
In this section
The following topics contain the schemas and mappings for the AdventureWorks data.
- AdventureWorks Complete Conceptual Schema (EDM)
Describes the conceptual schema used to build the programming object model.
- AdventureWorks Complete Storage Schema (EDM)
Describes the storage metadata used to make the data accessible to be mapped to the object model.
- AdventureWorks Complete Mapping Schema (EDM)
Describes the mapping between conceptual model and storage metadata.
- Using the AdventureWorks Object Model (EDM)
Describes code scenarios used to access entities and associations in the AdventureWorks Model object