Generate Enum from Lookup Tables - EF 6

c# database-first ef-database-first entity-framework entity-framework-6

Accepted Answer

One method is to use a T4 Template, which will create your Enums from the database automatically.

I've applied Here is a fantastic model. to a few projects. Make sure the script's assumptions about the format of your data are accurate (i.e., that the ids are named), then just alter the connection string.TableNameID ). The template should then be run after include the appropriate.tt files for each Enum.

0
3/16/2015 7:22:15 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow