locked
EF6 Code First - External Enums RRS feed

  • Question

  • I am setting up Entity Framework 6 using Code First. Some of my models will be using Enums, and these Enums exist in an external assembly. I know in Model First I was able to specify and external reference to an Enum. Can the same thing be done using Code First?

    I've searched the web, but haven't had any luck finding an answer. Any help is appreciated.

    Wednesday, September 17, 2014 8:58 PM

Answers

  • Hello wsharp07,

    >>Can the same thing be done using Code First?

    If you mean that you have separate assembly which contains all the enumerate types and you want to use these types in your code first model. If it is, yes, you could assume that the enumerate type is defined in the entity model after referencing the enumerate assembly. It would generate the enumerate type column in database even this type is referenced from an extern assembly.

    If i do not understand your correctly, please feel free let me know

    Best Regards,

    Fred.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Fred Bao Friday, September 26, 2014 9:08 AM
    Thursday, September 18, 2014 2:12 AM