I am trying to implement db context global filtering using EntityFramework.DynamicFilters (https://www.nuget.org/packages/EntityFr ... micFilters).
I am using EF6, Postgre 9.4 and dotConnect 7.4.592.
Unfortunatelly i got an error in case of using nullable filter - could not determine data type of parameter $1.
Running the failing case with npgsql driver succeeds.
I am attaching simple project where the situation can be replayed.SELECT
"Extent1"."Id",
"Extent1"."SimpleName",
"Extent1"."TenantId"
FROM dbo."EntityAs" AS "Extent1"
WHERE (((("Extent1"."TenantId" IS NULL) AND (:DynamicFilterParam_1 IS NULL)) OR (("Extent1"."TenantId" IS NOT NULL) AND ("Extent1"."TenantId" = :DynamicFilterParam_1))) OR (CAST(:DynamicFilterParam_2 AS boolean) IS NOT NULL)) AND ("Extent1"."SimpleName" = 'a')
-- DynamicFilterParam_1: 'null' (Type = Int32, IsNullable = false)
-- DynamicFilterParam_2: 'null' (Type = Boolean, IsNullable = false)
-- Executing at 20.2.2016 21:50:37 +01:00
Prepare: SELECT
"Extent1"."Id",
"Extent1"."SimpleName",
"Extent1"."TenantId"
FROM dbo."EntityAs" AS "Extent1"
WHERE (((("Extent1"."TenantId" IS NULL) AND ($1 IS NULL)) OR (("Extent1"."TenantId" IS NOT NULL) AND ("Extent1"."TenantId" = $1))) OR (CAST($2 AS boolean) IS NOT NULL)) AND ("Extent1"."SimpleName" = 'a')
could not determine data type of parameter $1
-- Failed in 71 ms with error: could not determine data type of parameter $1
http://www.uschovna.cz/zasilka/HMWEI5RI9GSR4R2F-UH7/
To run the project please modify connection string, create postgre db, create schema dbo and run Update-Database migration command and run unit tests.