Hi,
I have a problem querying data from a table with a nullable tinyint column.
The problem seems to be that the query is generated as:
AND ( CAST( [Extent1].[PositionEffect] AS int) = @p__linq__3)
=> @p_linq_3 = NULL
If i run that query manually it doesn't turn up any results. However, when I replace the query with:
AND ([Extent1].[PositionEffect] IS @p__linq__3)
it turns up the expected results.
My C# query looks like this:
context.Allocations.Where(x => ... && x.PositionEffect == (byte?) positionEffect)
So, why is the entity framework generating the incorrect query here and is there any way to fix this?
Thanks,
Tom