Udostępnij za pośrednictwem


How to: Use EdmGen.exe to Generate Object-Layer Code

This topic shows how to use the EDM Generator (EdmGen.exe) tool to generate object-layer code based on the .csdl file.

To generate object-layer code 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.

  2. Generate the School model or obtain the School.csdl file. For more information, see How to: Use EdmGen.exe to Generate the Model and Mapping Files.

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

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

To generate object-layer code 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.

  2. Generate the School model or obtain the School.csdl file. For more information, see How to: Use EdmGen.exe to Generate the Model and Mapping Files.

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

    "%windir%\Microsoft.NET\Framework\v4.0.30319\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
How to: Use EdmGen.exe to Generate the Model and Mapping Files

Other Resources

Modeling and Mapping
Entity Data Model Tools

Build Date:

2015-07-20