EF5 Code First Enums and Lookup Tables

后端 未结 6 1739
南笙
南笙 2020-11-27 05:35

I\'d like to define an enum for EF5 to use, and a corresponding lookup table. I know EF5 now supports enums, but out-of-the-box, it seems it only supports this at the objec

6条回答
  •  忘掉有多难
    2020-11-27 06:07

    Here's a nuget package I made earlier that generates lookup tables and applies foreign keys, and keeps the lookup table rows in sync with the enum:

    https://www.nuget.org/packages/ef-enum-to-lookup

    Add that to your project and call the Apply method.

    Documentation on github: https://github.com/timabell/ef-enum-to-lookup

提交回复
热议问题