Thursday, June 4, 2009

LINQ to Entity - EDMGen Tool

Scope -  EDMGen Tool



Along with the robust designer tools that integrate directly into the Visual Studio IDE, there is also an option of using the command-line tool, EdmGen (EdmGen.exe) to create your EDM metadata. The EdmGen tool can be used for the following EF tasks:


  • Generating CSDL, SSDL, and MSL files from a data source or from one another
  • Generating source code files from metadata (that is, CSDL, SSDL, MSL) or from a data source
  • Validating an existing EDM
  • Generating mapping views from SSDL, CSDL, or MSL data





Three examples using EdmGen. The first example shows the syntax for generating a complete EDM from the AdventureWorks database. In this example, EdmGen will create the CSDL, SSDL,

MSL, object, and source code for all tables in the AdventureWorks database. The second example generates the entire EDM, but starts with an SSDL file instead of a database. The third and final

example validates the EDM metadata.


Listing 5-7. Example EdmGen.exe Syntax


EdmGen.exe /mode:FullGeneration /project:AdventureWorks


      /connectionstring:"server=.\sqlexpress;integrated security=true;database=AdventureWorks"


EdmGen.exe /mode:FromSSDLGeneration




EdmGen.exe /mode:ValidateArtifacts





Thanks & Regards,

Arun Manglick || Senior Tech Lead


No comments:

Post a Comment