views:

206

answers:

2

Can I generate entity framework model by clicking button in browser in client-side and save it back to web server PC?

+1  A: 

EdmGen is the way to go if you're sure this is the best solution to your problem: http://msdn.microsoft.com/en-us/library/bb896270.aspx

If you're having problems with it could you please post the command line arguments you're using to call it?

You'll have to create a process in your web app (System.Diagnostics.Process) in order to kick off the executable from the browser side.

David Neale
+1  A: 

As David Neale says EmdGen is an option, if that is really what you want.

There is also EmdGen2, which has the advantage that it is able to work directly with the Edmx file:

EdmGen2 is a command-line tool for the Microsoft ADO.NET Entity Framework. The tool can be used as a replacement for the EdmGen.exe tool that ships with the .Net framework 3.5 SP1. EdmGen.exe can only read and write the CSDL, SSDL & MSL file formats. However, EdmGen2.exe can read and write the EDMX file format used by the Visual Studio design tools. Additionally, EdmGen2.exe can translate between EDMX and CSDL, SSDL & MSL formats, and the source code can act as examples on using the tooling APIs defined in the System.Data.Entity.Design assembly.

Additionaly, EdmGen2.exe contains some experimental functionality not found in EdmGen.exe. Ankit Malpani, an intern with Microsoft Research in summer of 2008, and James Terwilliger, a Post Doc researcher with MSR, updated EdmGen2.exe with the ability to identify inheritance relatationships in relational database schema. You can access this functionality by using the "RetrofitModel" option. The RetrofitModel option connects to a database instance and constructs an EDM model (csdl, msl, ssdl, and edmx files) that includes inheritance. The tool uses data mining techniques to identify TPT and TPH patterns in the database instance, as well as vertical partitioning, and constructs a suitable model and mapping. To use the tool, launch EdmGen2 with the following arguments:

Luhmann