Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled expression type: 'Default' #122

Open
colinblaise opened this issue Mar 23, 2021 · 1 comment
Open

Unhandled expression type: 'Default' #122

colinblaise opened this issue Mar 23, 2021 · 1 comment
Milestone

Comments

@colinblaise
Copy link

On .net core 5.0.102

I believe Sieve hasn't been updated to play nice with ef core 5, but I wanted to post this here to catalog the issue.

Receiving the following exception:

Sieve.Exceptions.SieveException: 'Unhandled expression type: 'Default'

Inner stack trace:

   at LinqKit.ExpressionVisitor.Visit(Expression exp)
   at LinqKit.ExpressionVisitor.VisitBinary(BinaryExpression b)
   at LinqKit.ExpressionVisitor.Visit(Expression exp)
   at LinqKit.ExpressionVisitor.VisitBinary(BinaryExpression b)
   at LinqKit.ExpressionVisitor.Visit(Expression exp)
   at LinqKit.ExpressionVisitor.VisitLambda(LambdaExpression lambda)
   at LinqKit.ExpressionVisitor.Visit(Expression exp)
   at LinqKit.ExpressionVisitor.VisitUnary(UnaryExpression u)
   at LinqKit.ExpressionVisitor.Visit(Expression exp)
   at LinqKit.ExpressionVisitor.VisitExpressionList(ReadOnlyCollection`1 original)
   at LinqKit.ExpressionVisitor.VisitMethodCall(MethodCallExpression m)
   at LinqKit.ExpressionExpander.VisitMethodCall(MethodCallExpression m)
   at LinqKit.ExpressionVisitor.Visit(Expression exp)
   at LinqKit.Extensions.Expand(Expression expr)
   at LinqKit.ExpandableQueryProvider`1.System.Linq.IQueryProvider.CreateQuery[TElement](Expression expression)
   at Sieve.Services.SieveProcessor`3.ApplyFiltering[TEntity](TSieveModel model, IQueryable`1 result, Object[] dataForCustomMethods)
   at Sieve.Services.SieveProcessor`3.Apply[TEntity](TSieveModel model, IQueryable`1 source, Object[] dataForCustomMethods, Boolean applyFiltering, Boolean applySorting, Boolean applyPagination)

Error is thrown when calling sieveProcessor.Apply(sieveModel, q);

The query works just fine when I do not use sieveProcesor.

A quick Google shows that the error may be getting thrown here: https://github.com/scottksmith95/LINQKit/blob/master/src/LinqKit.Core/ExpressionVisitor.cs#L90

@TheoBP
Copy link

TheoBP commented Jun 9, 2021

This only seems to happen when used in conjunction with AsExpandable() from LinQKit.

@ITDancer13 ITDancer13 added this to the v3.0 milestone Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants