Friday, 21 September 2012

Entity Framework Bug

If you are using Entity Framework in .NET I advise you not to trust it's SQL. Today I discovered that:
joinedSc.NullableBoolProperty != true
Is executed as:
cast(as bit) <> [Extent1].[NullableBoolProperty]
When in fact it should be (depending on your database settings):
[Extent1].[NullableBoolProperty] is not null  
or cast(as bit) <> [Extent1].[NullableBoolProperty]
Well done Microsoft!
 

No comments:

Post a Comment