-
Notifications
You must be signed in to change notification settings - Fork 38
Nullable types and EntityFramework.Filters #20
Comments
If your WHERE ([Extent1].[NullableProperty] = @p__linq__0) its right. WHERE (([Extent1].[NullableProperty] IS NULL) AND (@p__linq__0 IS NULL)) |
EF 6 has new default behavior - it translates queries for nullable types using this syntax: WHERE (([Extent1].[NullableProperty] = @p__linq__0) OR (([Extent1].[NullableProperty] IS NULL) AND (@p__linq__0 IS NULL))) After adding |
I had the same issue in my own extended filterung framework. It's a pretty simple change of the new EF versions > 6.0. They introduced a new property context.Configuration.UseDatabaseNullSemantics. The same property was introduced in the class DbQueryCommandTree, which must be created when filtering the base tree. .... That's it :-) |
I have fix localy by remplacing in FilterInterceptor.cs: interceptionContext.Result = new DbQueryCommandTree( by interceptionContext.Result = new DbQueryCommandTree( If I have time, I fork and PR after work. |
EntityFramework 6.
The query:
Without
EntityFramework.Filters
it translates to:After adding filter interceptor (both in
DbConfiguration
class or in OnModelCreating) the query is translated to:DBContext.Configuration.UseDatabaseNullSemantics = false;
does not fix anything.The text was updated successfully, but these errors were encountered: