none
EF 6: Database First - Enum/Lookup Tables RRS feed

  • General discussion

  • Hi all,

    I am migrating from Codesmith to EF 6.0 and have many lookup tables in my existing database schema.

    What is the best approach to re-using the lookup tables? 

    Do I just re-add them through my edmx file?

    (I have also seen people writing T4 scripts in order to fill the data). 

    Thanks in advance!

    Keith. 

    • Changed type Fred BaoModerator Monday, April 21, 2014 7:16 AM The discussion type is more suitable for this case
    Monday, March 31, 2014 4:15 PM

All replies

  • If the table has a primary key and a description field, then you should be able to query it.
    Monday, March 31, 2014 11:31 PM
  • I would like to store the values in an enumerator
    Tuesday, April 1, 2014 8:22 AM
  • A common approach seems to be generating enum classes using T4 templates

    http://www.toplinestrategies.com/dotneters/net/table-to-enum-using-t4-template/

    Seems a little long winded

    I'm surprised that we cannot link a enum type to an existing lookup table

    Tuesday, April 1, 2014 9:23 AM