Modelo completo (EDM) de AdventureWorks

Muchas aplicaciones que están basadas en Entity Data Model (EDM) requieren los esquemas de asignación a una base de datos que ya está en uso. La asignación a datos existentes es más complejo que implementar el modelo de almacenamiento una vez finalizado el diseño conceptual.

La base de datos AdventureWorks que se incluye con SQL Server es una base de datos grande y normalizada, diseñada para mostrar las características de SQL Server. Hay cinco subsecciones de la base de datos de AdventureWorks y todas se pueden especificar en un único EntityContainer utilizando el lenguaje de definición de esquemas conceptuales (CSDL). Los metadatos describen el modelo de almacenamiento en el lenguaje de definición de esquemas de almacenamiento (SSDL). La asignación entre esquemas conceptual y de almacenamiento se hace en el lenguaje de especificación de asignaciones (MSL).

Todos los esquemas de los temas siguientes se generaron mediante la herramienta de línea de comandos EdmGen.exe. La sintaxis del comando único que se usa incluye los modificadores /FullGeneration y /Project:AdventureWorks, /Provider, así como una cadena de conexión a la base de datos AdventureWorks.

C:\>%windir%\Microsoft.NET\Framework\v3.5\edmgen.exe /mode:fullgeneration /project:AdventureWorks
 /provider:System.Data.SqlClient 
/connectionstring:"server=.\sqlExpress;
integrated security=true;database=AdventureWorks" /outssdl:c:\BuildSchemas\AdventureWorks.ssdl /outcsdl:c:\BuildSchemas\AdventureWorks.csdl 
/outmsl:c:\BuildSchemas\AdventureWorks.msl 
/outViews:c:\BuildSchemas\AdventureWorks.Views.cs
 /outObjectLayer:c:\BuildSchemas\AdventureWorks.ObjectLayer.cs

La herramienta generó correctamente los esquemas para esta base de datos muy grande. El esquema CSDL es la especificación que se utiliza para construir los objetos programables para todas las demás características de la base de datos AdventureWorks. La salida se muestra a continuación.

Microsoft (R) EdmGen version 3.5.0.0
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Loading database information...
warning 6002: The table/view 'AdventureWorks.HumanResources.vEmployee' does not
have a primary key defined. The key has been inferred and the definition was cre
ated as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.HumanResources.vEmployeeDepartment'
 does not have a primary key defined. The key has been inferred and the definiti
on was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.HumanResources.vEmployeeDepartmentH
istory' does not have a primary key defined. The key has been inferred and the d
efinition was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.HumanResources.vJobCandidate' does
not have a primary key defined. The key has been inferred and the definition was
 created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.HumanResources.vJobCandidateEducati
on' does not have a primary key defined. The key has been inferred and the defin
ition was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.HumanResources.vJobCandidateEmploym
ent' does not have a primary key defined. The key has been inferred and the defi
nition was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Person.vAdditionalContactInfo' does
 not have a primary key defined. The key has been inferred and the definition wa
s created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Person.vStateProvinceCountryRegion'
 does not have a primary key defined. The key has been inferred and the definiti
on was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Production.vProductAndDescription'
does not have a primary key defined. The key has been inferred and the definitio
n was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Production.vProductModelCatalogDesc
ription' does not have a primary key defined. The key has been inferred and the
definition was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Production.vProductModelInstruction
s' does not have a primary key defined. The key has been inferred and the defini
tion was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Purchasing.vVendor' does not have a
 primary key defined. The key has been inferred and the definition was created a
s a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Sales.vIndividualCustomer' does not
 have a primary key defined. The key has been inferred and the definition was cr
eated as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Sales.vIndividualDemographics' does
 not have a primary key defined. The key has been inferred and the definition wa
s created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Sales.vSalesPerson' does not have a
 primary key defined. The key has been inferred and the definition was created a
s a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Sales.vSalesPersonSalesByFiscalYear
s' does not have a primary key defined. The key has been inferred and the defini
tion was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Sales.vStoreWithDemographics' does
not have a primary key defined. The key has been inferred and the definition was
 created as a read-only table/view.
Writing ssdl file...
Creating conceptual layer from storage layer...
Writing msl file...
Writing csdl file...
Writing object layer file...
Writing views file...

Generation Complete -- 0 errors, 17 warnings

En esta sección

Los temas siguientes contienen los esquemas y asignaciones para los datos de AdventureWorks.

Vea también

Otros recursos

Especificaciones del EDM
Especificación de asignaciones y esquemas (Entity Framework)
Especificación de asignaciones y esquemas (Entity Framework)