Can't use the boolean literal 'false'

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Wain123
Posts: 12
Joined: Wed 07 Jun 2017 07:25

Can't use the boolean literal 'false'

Post by Wain123 » Wed 21 Jun 2017 13:08

I have a NUMBER(1) column mapped to a bool? property.
The following code throws a System.InvalidOperationException: 'The binary operator Equal is not defined for the types 'System.Nullable`1[System.Boolean]' and 'System.Boolean''

Code: Select all

ctx.Test.Where(z => z.Active == false).Count();
The following code works correctly:

Code: Select all

ctx.Test.Where(z => z.Active == true).Count();

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Can't use the boolean literal 'false'

Post by Shalex » Thu 29 Jun 2017 19:30

Thank you for your report. We will notify you when the issue is fixed.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Can't use the boolean literal 'false'

Post by Shalex » Fri 04 Aug 2017 16:13

The bug with comparison and binary operations in EF Core is fixed: viewtopic.php?f=1&t=35777.

Post Reply