EF Core Global Query Filter with Nullable Exception
Hi friends, I'm try to create a
Global query filter
for my EF Core
, to be honest this is the first time for me with Global Query Filters
In my AppDbContext
=> OnModelCreating
I tried this:
How my IArchivable
looks like:
The Issue:
When I start the app, automatically II get this exception
:
InvalidOperationException: The binary operator Equal is not defined for the types 'System.Nullable`1[System.Boolean]' and 'System.Boolean'.I think the issue related with the
Nullable
IsArchived
property, may I need to add an OR
to my Expression
,
My Questions:
What is the cause of that issue?
If the Nullable
of the IsArchived
how to fix it ?
If I need to ad an OR
to my expression
to check the Nullability
of ISArchived
how to do it ?
Massive thanks in advance <31 Reply
Screenshot of the Exception: