简体   繁体   中英

Generating Entity Classes using edmgen

I have a edmx file created using the entity entity framework model.

Whenever I make some changes in the edmx(Like removing a column from the entity), I would like to generate the entity classes( Designer.cs ). I know I can do this by right clicking the edmx file and Run custom tool

I wanted to do this using edmgen tool. But the edmgen tool needs the msdl and csdl files. But I have all the contents in the edmx file.

Is there any way to specify the edmx file to the edmgen command.

If you have configured everything correctly .Designer.cs file should be generated automatically without using Run custom tool . EDMX is just file for Visual Studio - you must use MSL, CSDL and SSDL for EdmGen. You can set up your EDMX to generate SSDL, MSL and CSDL files for you but in such case you will also have to use these files in deployment and connection string instead of resources used by default. To set up this change Metadata Artifacts Processing from Embed in Output Assembly to Copy to Output Directory .

You can also check EdmGen2 which should be able to opeerate with EDMX directly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM