After upgrading to version 2.1 started getting errors with such queries:
var t = VehicleTypes.Truck;
context.Vehicles.Where(x => x.TypeId == (int)t)
throwing exception:
System.InvalidCastException: Can't write CLR type VehicleTypes with handler type Int32Handler
If code is changed to:
int t = (int)VehicleTypes.Truck;
context.Vehicles.Where(x => x.TypeId == t)
it works.
I guess it's because of new strict parameter type handling, but is this really the place for it trigger error? The enum value is supplied with a cast to correct type.
Is this intended? It would require a lot of refactoring in our project.
After upgrading to version 2.1 started getting errors with such queries:
var t = VehicleTypes.Truck;context.Vehicles.Where(x => x.TypeId == (int)t)throwing exception:
If code is changed to:
int t = (int)VehicleTypes.Truck;context.Vehicles.Where(x => x.TypeId == t)it works.
I guess it's because of new strict parameter type handling, but is this really the place for it trigger error? The enum value is supplied with a cast to correct type.
Is this intended? It would require a lot of refactoring in our project.