Reputation: 28121
I want to generate Entity Framework 4.0 classes from a (legacy) database from a command line, but I have 2 transformations I want:
Any idea how this might be accomplished? I'm a total newbie to EF, but I have a decent understanding of Linq to Sql and was able to accomplish the same task by doing: sqlmetal -> dbml -> xml mapping file and .cs file.
Upvotes: 1
Views: 548
Reputation: 126547
The EDMX is also XML. If you're comfortable with XML transformations, just change the CSDL section of the file per your renaming rules. Then do a full build on your app and the code should be regenerated. To do this from the command line, use EdmGen
, which comes with the framework. The free EdmGen2 utility is worth a look; it may already do some of what you need.
Upvotes: 2