Page 1 of 1

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
by Wain123
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'.'

Code: Select all

Console.WriteLine(ctx.Test.Where(z => z.Num == 5m).Count());
On the other hand, the following code works correctly:

Code: Select all

decimal d = 5m;
Console.WriteLine(ctx.Test.Where(z => z.Num == d).Count());

Re: When using decimal literals: "The operands for operator 'Equal' do not match the parameters of method 'op_Equality'."

Posted: Fri 30 Jun 2017 09:31
by Shalex
Thank you for your report. We have reproduced the issue and will notify you when it is fixed.

Re: When using decimal literals: "The operands for operator 'Equal' do not match the parameters of method 'op_Equality'."

Posted: Fri 04 Aug 2017 16:07
by Shalex
The bug with comparison and binary operations in EF Core is fixed: viewtopic.php?f=1&t=35777.