Wednesday, 15 May 2013

c# - Generate Enum from Lookup Tables - EF 6 -


It can be repeated but I have gone through all the available positions but the EF 6 version did not understand the best method.

I have two tables

  PersonPhone (PersonID, PhoneTypeID) Phone Type (Phonetype ID, Details)  

as phonetips See just the up (cell, office, pager etc). How can I generate the same aromas in the code from the PhoneTip table?

Can anyone take steps to generate an enamel to see the tables? Thanks in advance

On the one hand, with a T4 template that automatically saves your enema from the table Will generate

Change the connection string, and make sure that the script assumptions about the format of your data are correct (that is, the name of the ID is TableNameID ) that I used in some projects. . Then add appropriate .tt files to each Enum, and run the template.


No comments:

Post a Comment