public class MyModel {
public MyEnum? EnumProp {get; set;}
[Computed]
public bool IsTwo => EnumProp == MyEnum.Two
}
If I try and execute the query after decompiling I get this error:
LINQ to Entities does not recognize the method 'MyEnum GetValueOrDefault()' method, and this method cannot be translated into a store expression
For some reason it is adding a GetValueOrDefault() call on to EnumProp from within IsTwo
Let's say I have these classes:
public enum MyEnum { One, Two }
public class MyModel { public MyEnum? EnumProp {get; set;} [Computed] public bool IsTwo => EnumProp == MyEnum.Two }
If I try and execute the query after decompiling I get this error: LINQ to Entities does not recognize the method 'MyEnum GetValueOrDefault()' method, and this method cannot be translated into a store expression
For some reason it is adding a GetValueOrDefault() call on to EnumProp from within IsTwo