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

Is Enum filtering supported #31

Open
TAXSET opened this issue Jul 10, 2023 · 0 comments
Open

Is Enum filtering supported #31

TAXSET opened this issue Jul 10, 2023 · 0 comments

Comments

@TAXSET
Copy link

TAXSET commented Jul 10, 2023

Hi, I'm currently feeling a bit dumb as I can't get filtering with enums to work.

I'm trying to filter with the ordinal / int value of the enum, however, it fails to map the int to the corresponding enum value:

2023-07-10 08:13:35.3869|ERROR|MYPROJECT.Common.ErrorLogHandler.Helpers.LoggerService|System.InvalidOperationException: The binary operator Equal is not defined for the types 'MYPROJECT.API.DataAccess.DB.Enums.EUserRole' and 'System.Int32'.
   at System.Linq.Expressions.Expression.GetEqualityComparisonOperator(ExpressionType binaryType, String opName, Expression left, Expression right, Boolean liftToNull)
   at System.Linq.Expressions.Expression.Equal(Expression left, Expression right, Boolean liftToNull, MethodInfo method)
   at DynamicExpresso.Parsing.Parser.GenerateEqual(Expression left, Expression right)
   at DynamicExpresso.Parsing.Parser.ParseComparison()
   at DynamicExpresso.Parsing.Parser.ParseLogicalAnd()
   at DynamicExpresso.Parsing.Parser.ParseLogicalXor()
   at DynamicExpresso.Parsing.Parser.ParseLogicalOr()
   at DynamicExpresso.Parsing.Parser.ParseConditionalAnd()
   at DynamicExpresso.Parsing.Parser.ParseConditionalOr()
   at DynamicExpresso.Parsing.Parser.ParseConditional()
   at DynamicExpresso.Parsing.Parser.ParseAssignment()
   at DynamicExpresso.Parsing.Parser.ParseExpressionSegment()
   at DynamicExpresso.Parsing.Parser.ParseParenExpression()
   at DynamicExpresso.Parsing.Parser.ParsePrimaryStart()
   at DynamicExpresso.Parsing.Parser.ParsePrimary()
   at DynamicExpresso.Parsing.Parser.ParseUnary()
   at DynamicExpresso.Parsing.Parser.ParseMultiplicative()
   at DynamicExpresso.Parsing.Parser.ParseAdditive()
   at DynamicExpresso.Parsing.Parser.ParseTypeTesting()
   at DynamicExpresso.Parsing.Parser.ParseComparison()
   at DynamicExpresso.Parsing.Parser.ParseLogicalAnd()
   at DynamicExpresso.Parsing.Parser.ParseLogicalXor()
   at DynamicExpresso.Parsing.Parser.ParseLogicalOr()
   at DynamicExpresso.Parsing.Parser.ParseConditionalAnd()
   at DynamicExpresso.Parsing.Parser.ParseConditionalOr()
   at DynamicExpresso.Parsing.Parser.ParseConditional()
   at DynamicExpresso.Parsing.Parser.ParseAssignment()
   at DynamicExpresso.Parsing.Parser.ParseExpressionSegment()
   at DynamicExpresso.Parsing.Parser.ParseExpressionSegment(Type returnType)
   at DynamicExpresso.Parsing.Parser.Parse()
   at DynamicExpresso.Parsing.Parser.Parse(ParserArguments arguments)
   at DynamicExpresso.Interpreter.ParseAsLambda(String expressionText, Type expressionType, Parameter[] parameters)
   at DynamicExpresso.Interpreter.ParseAs[TDelegate](String expressionText, String[] parametersNames)
   at DynamicExpresso.Interpreter.ParseAsExpression[TDelegate](String expressionText, String[] parametersNames)
   at Fop.Extensions.ApplyFop[T](IQueryable`1 source, IFopRequest request)
   at MYPROJECT.API.BusinessLogic.Services.UserService.PaginateUser(IFopQuery searchQuery, IQueryable`1 query) in C:\Path\To\Project\api\MYPROJECT.API.BusinessLogic\Services\UserService.cs:line 332
   at MYPROJECT.API.BusinessLogic.Services.UserService.GetAllUsersAsync(IFopQuery searchQuery) in C:\Path\To\Project\api\MYPROJECT.API.BusinessLogic\Services\UserService.cs:line 132
   at MYPROJECT.API.Controllers.UserController.GetAllUser(SearchFilterQuery searchQuery) in C:\Path\To\Project\api\MYPROJECT.API\Controllers\UserController.cs:line 43
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

1 participant