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
{{ message }}
Repository navigation
Better error when trying to use EF.Constant/Parameter with compiled queries and query filters #38151
System.InvalidCastException: Unable to cast object of type 'System.Linq.Expressions.ConstantExpression' to type 'Microsoft.EntityFrameworkCore.Query.QueryParameterExpression'.
See #33674 for the original change in the EF.Constant/Parameter implementation that introduced the incompatibility with compiled queries; and #38150 for a recent report triggering this issue.
changed the title [-]Better error when trying to use EF.Constant/Parameter with compiled queries[/-][+]Better error when trying to use EF.Constant/Parameter with compiled queries and query filters[/+]on Apr 22, 2026
Activity
MihuBot commentedon Apr 21, 2026
I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):
EF.Constantfails inside method-call argument inEF.CompileAsyncQuery#38150Better error when using EF.Constant/Parameter with compiled queries o…
[-]Better error when trying to use EF.Constant/Parameter with compiled queries[/-][+]Better error when trying to use EF.Constant/Parameter with compiled queries and query filters[/+]Better error when using EF.Constant/Parameter with compiled queries o…
Better error when using EF.Constant/Parameter with compiled queries o…