You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into a real head scratcher today, and I think I figured out the root cause. I wrote up the whole issue at IntelliTect/Coalesce#25, which I'd encourage a read through of to get context for this. Look specifically at the (System.Object) cast in the second query's DebugView.
Basically, it seems that type conversions are being generated in cases where they aren't strictly needed, and this is causing EF Core to get confused when interpreting query results. The fault partly lies with EF Core, but I figure a change here will be easier to accomplish than a change to EF Core.
When there is a literal null as one of the two operands in an equality operator, I'm guessing that it is assumed to have type "System.Object", and so the left-hand side is being explicitly converted to System.Object. Would it be possible to add handling here to check for literal null and skip the emission of a conversion in such cases? Or am I way off base here on what is causing this cast to be created?
Thanks for taking a look, and thanks for maintaining this library!
The text was updated successfully, but these errors were encountered:
I ran into a real head scratcher today, and I think I figured out the root cause. I wrote up the whole issue at IntelliTect/Coalesce#25, which I'd encourage a read through of to get context for this. Look specifically at the
(System.Object)
cast in the second query's DebugView.Basically, it seems that type conversions are being generated in cases where they aren't strictly needed, and this is causing EF Core to get confused when interpreting query results. The fault partly lies with EF Core, but I figure a change here will be easier to accomplish than a change to EF Core.
I believe the culprit to be this spot: https://github.com/StefH/System.Linq.Dynamic.Core/blob/master/src/System.Linq.Dynamic.Core/ExpressionParser.cs#L1464
When there is a literal null as one of the two operands in an equality operator, I'm guessing that it is assumed to have type "System.Object", and so the left-hand side is being explicitly converted to System.Object. Would it be possible to add handling here to check for literal null and skip the emission of a conversion in such cases? Or am I way off base here on what is causing this cast to be created?
Thanks for taking a look, and thanks for maintaining this library!
The text was updated successfully, but these errors were encountered: