Page 1 of 1

enum example with Code First

Posted: Wed 18 Jan 2012 19:37
by chopswil
could you update your Code First sample, http://www.devart.com/blogs/dotconnect/ ... irstsample, to include how enums can be supported and use fluent model builder?

My real world problem is I have a class that I can't modify, it has an enum data type and I need to put the int value into a DB.
I need a fluent way, since I can't change the class, to say this class' enum data type maps to a given DB field and it is an int.
and I'd like to see an example of how to do linq against this field using enum values

edit: and bitwise enums too :)

thanks

Posted: Fri 20 Jan 2012 16:39
by Shalex
There is no official support of enums in Entity Framework yet. Only particular support is available in Entity Framework June 2011 CTP. Enums will be fully supported in Entity Framework 5.0 (with .NET Framework 4.5).