Compartir a través de


How to: Use EdmGen.exe to Generate Object Model Files (Entity Framework)

This topic shows how to use the EDM Generator (EdmGen.exe) tool to generate object model files that are based on the conceptual model file from an Entity Data Model (EDM). For more information, see Entity Data Model.

To generate the object model file for the School model for a Visual Basic project using EdmGen.exe

  1. Create the School database. For more information, see Creating the School Sample Database (Entity Framework Quickstart).

  2. Generate the School model or obtain the School.csdl file. For more information, see How to: Use EdmGen.exe to Generate an Entity Data Model (Entity Framework).

  3. At the command prompt, execute the following command without line breaks:

    "%windir%\Microsoft.NET\Framework\v3.5\edmgen.exe" /mode:EntityClassGeneration 
    /incsdl:.\School.csdl /outobjectlayer:.\School.Objects.vb /language:VB
    

To generate the object model file for the School model for a C# project using EdmGen.exe

  1. Create the School database. For more information, see Creating the School Sample Database (Entity Framework Quickstart).

  2. Generate the School model or obtain the School.csdl file. For more information, see How to: Use EdmGen.exe to Generate an Entity Data Model (Entity Framework).

  3. At the command prompt, execute the following command without line breaks:

    "%windir%\Microsoft.NET\Framework\v3.5\edmgen.exe" /mode:EntityClassGeneration 
    /incsdl:.\School.csdl /outobjectlayer:.\School.Objects.cs /language:CSharp
    

See Also

Tasks

How to: Manually Configure an Entity Framework Project
How to: Pre-Generate Views to Improve Query Performance (Entity Framework)
How to: Use EdmGen.exe to Generate an Entity Data Model (Entity Framework)

Other Resources

Defining an Entity Data Model (Entity Framework Tasks)
Entity Data Model Tools