简体   繁体   中英

How can I programmatically generate Entity Framework classes from a database?

How can I programmatically generate Entity Framework classes from a database and then automatically compile them?

I'm looking for a solution that takes a simple connection string and generates a C# library. Exactly what Visual Studio's entity designer does but programmatically.

You are looking for Entity Framework power tools .

With that you can create a code first database from a connectionstring (Reverse Engineer Code First ).

With Reverse Engineer Code First you get the code first classes + mapping classes. You can even modify the templates used for the process. All the information you need can be found in the above link.

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