When using decimal literals: "The operands for operator 'Equal' do not match the parameters of method 'op_Equality'."
Posted: Wed 21 Jun 2017 12:53
I have a NUMBER(28,12) column mapped to a decimal? property. The following code throws a System.InvalidOperationException: 'The operands for operator 'Equal' do not match the parameters of method 'op_Equality'.'
On the other hand, the following code works correctly:
Code: Select all
Console.WriteLine(ctx.Test.Where(z => z.Num == 5m).Count());
Code: Select all
decimal d = 5m;
Console.WriteLine(ctx.Test.Where(z => z.Num == d).Count());