I'm trying to get specific data from db with this code
Bunts = _buntRepository.Bunts
.Where(b => !steel.HasValue || b.SteelCode == steel)
.OrderBy(b => b.CreationTime)
.Skip((page - 1) * _pageSize)
.Take(_pageSize)
Entity framework generates this SQL statement for it:
SELECT FIRST (5) SKIP (0)
"B"."BUNTCODE" AS "BUNTCODE",
"B"."BUNTNAME" AS "BUNTNAME",
"B"."BUNTDIAM" AS "BUNTDIAM",
"B"."BUNTSTEEL" AS "BUNTSTEEL",
"B"."BUNTCREATETIME" AS "BUNTCREATETIME"
FROM ( SELECT
"D"."BUNTCODE" AS "BUNTCODE",
"D"."BUNTNAME" AS "BUNTNAME",
"D"."BUNTDIAM" AS "BUNTDIAM",
"D"."BUNTSTEEL" AS "BUNTSTEEL",
"D"."BUNTCREATETIME" AS "BUNTCREATETIME"
FROM "BUNTS" AS "D"
WHERE (("D"."BUNTSTEEL" = @p__linq__1) OR (("D"."BUNTSTEEL" IS NULL) AND (@p__linq__1 IS NULL)))
) AS "B"
ORDER BY "B"."BUNTCREATETIME" ASC
This code throws exception with text
Dynamic SQL Error.
SQL error code = -804.
Data type unknown.
Same does IBExpert. Seems like something wrong with @p__linq__1 parameter. How do I solve this problem?
I'm using Firebird 2.1.6.18547