Is there anyway to map int field into enum in EFv1? Thanks! I want my entity to have enum field rather than int field.
Create two properties. One mapped to EF, one as a wrapper
[EdmScalarProperty]
public int EnumPropInteger {get;set}
public MyEnum EnumProp
{
get { return (MyEnum) EnumPropInteger; }
set { EnumPropInteger = (int)value; }
}
Not a nice way because you have two public properties but a way.
It's supported with the new release : Now supported : http://blogs.msdn.com/b/adonet/archive/2011/06/30/announcing-the-microsoft-entity-framework-june-2011-ctp.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With