Page 1 of 1

When using "this" in LINQ: "The operands for operator 'Equal' do not match the parameters of method 'op_Equality'."

Posted: Wed 28 Jun 2017 11:57
by Wain123
The following code in my Blog entity:

Code: Select all

foreach (var x in Ctx.Posts.Where(z => z.Blog == this)) {
}
throws System.InvalidOperationException: 'The operands for operator 'Equal' do not match the parameters of method 'op_Equality'.'

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

Posted: Fri 30 Jun 2017 11:20
by Shalex
Thank you for your report. We will investigate the issue and notify you about the result.

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

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