locked
enum support RRS feed

  • Question

  • It would be nice if, in the conceptual model (or a designer for that model), id you could define particular lookup tables as enumerations to be generated in the model classes.

     

    I have quite a few tables that I'd rather not lookup, but have defined as enums in the generated code.

     

    steven

    http://livz.org

    Tuesday, August 7, 2007 2:16 PM

Answers

  • Some kind of support for enums in the entity framework is certainly a feature we'd like to have and have talked about, but it won't make this first release.  Unfortunately, there are definitely some complexities here--particularly for enums that are tracking lookup tables since of course the data in the lookup tables could change on the store (maybe your app doesn't do that, but it's hard to reason about that in a guaranteed fashion) but of course enums in code are statically determined at compile time.  This is not to say that there's nothing which can be done about this kind of thing--just that it's more complicated than it might seem at first thought, and the result is that it just isn't something that we can fit in the first release.

     

    Thanks for the feedback, though.  Please keep it coming!

     

    - Danny

    Tuesday, August 7, 2007 5:00 PM

All replies

  • Some kind of support for enums in the entity framework is certainly a feature we'd like to have and have talked about, but it won't make this first release.  Unfortunately, there are definitely some complexities here--particularly for enums that are tracking lookup tables since of course the data in the lookup tables could change on the store (maybe your app doesn't do that, but it's hard to reason about that in a guaranteed fashion) but of course enums in code are statically determined at compile time.  This is not to say that there's nothing which can be done about this kind of thing--just that it's more complicated than it might seem at first thought, and the result is that it just isn't something that we can fit in the first release.

     

    Thanks for the feedback, though.  Please keep it coming!

     

    - Danny

    Tuesday, August 7, 2007 5:00 PM
  • Yes, I can definitely see the complication.

    In my case i don't update them (other than to add) and if i did i would regenerate the code (perhaps this is where being able to generate multiple assemblies may be useful).

    But I appeciate you guys have more than just me to support Smile

    steven
    http://livz.org
    Wednesday, August 8, 2007 7:14 AM