RadzenDataFilter Fails To Filter On EF ManyToMany property #1086

Open
opened 2026-01-29 17:48:44 +00:00 by claunia · 0 comments
Owner

Originally created by @andrewbabbittdev on GitHub (Jan 9, 2024).

Describe the bug
RadzenDataFilter Fails To Filter On EF ManyToMany properties.

To Reproduce
I have a repro repository here: https://github.com/AndrewBabbitt97/ManyToMany

If you run it and attempt to set a filter on the Tags field you get the following exception:

fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
      Unhandled exception in circuit 'sbVgOBHji6R7Bnfe-vWyektx1jnmJBlvaR5lBYtSLII'.
      System.InvalidOperationException: No generic method 'Contains' on type 'System.Linq.Enumerable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic.
         at System.Linq.Expressions.Expression.FindMethod(Type type, String methodName, Type[] typeArgs, Expression[] args, BindingFlags flags)
         at System.Linq.Expressions.Expression.Call(Type type, String methodName, Type[] typeArguments, Expression[] arguments)
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseEnumerable(Expression instance, Type elementType, String methodName, Int32 errorPos, Type type)
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseMemberAccess(Type type, Expression expression)
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParsePrimary()
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseUnary()
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseArithmetic()
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAdditive()
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseShiftOperator()
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseComparisonOperator()
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLogicalAndOrOperator()
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIn()
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAndOperator()
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseOrOperator()
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLambdaOperator()
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseNullCoalescingOperator()
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseConditionalOperator()
         at System.Linq.Dynamic.Core.Parser.ExpressionParser.Parse(Type resultType, Boolean createParameterCtor)
         at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(Type delegateType, ParsingConfig parsingConfig, Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values)
         at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(ParsingConfig parsingConfig, Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values)
         at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(ParsingConfig parsingConfig, Boolean createParameterCtor, Type itType, Type resultType, String expression, Object[] values)
         at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where(IQueryable source, ParsingConfig config, String predicate, Object[] args)
         at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[TSource](IQueryable`1 source, ParsingConfig config, String predicate, Object[] args)
         at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[TSource](IQueryable`1 source, String predicate, Object[] args)
         at Radzen.QueryableExtension.Where[T](IQueryable`1 source, RadzenDataFilter`1 dataFilter)
         at Radzen.Blazor.RadzenDataFilter`1.get_View()
         at Radzen.Blazor.RadzenDataFilter`1.Filter()
         at Radzen.Blazor.RadzenDataFilterProperty`1.SetParametersAsync(ParameterView parameters)

Expected behavior
The grid should be filtered on the selected tags in the filter.

Screenshots
exception

Desktop (please complete the following information):

  • OS: Windows 11 23H2
  • Browser: Chrome 120
  • Version: Radzen 4.23.7 (Also tested against master, same issue)

Additional context
N/A

Originally created by @andrewbabbittdev on GitHub (Jan 9, 2024). <!-- IMPORTANT: Read this first!!! 1. If you own a Radzen Professional or Еnterprise subscription you can report your issue or ask us a question via email at info@radzen.com. Radzen staff will reply within 24 hours (Professional) or 16 hours (Enterprise) 2. The Radzen staff guarantees a response to issues in this repo only to paid subscribers. 3. If you have a HOW TO question start a new forum thread in the Radzen Community forum: https://forum.radzen.com. Radzen staff will close issues that are HOWTO questions. 4. Please adhere to the issue template. Specify all the steps required to reproduce the issue or link a project which reproduces it easily (without requiring extra steps such as restoring a database). --> **Describe the bug** RadzenDataFilter Fails To Filter On EF ManyToMany properties. **To Reproduce** I have a repro repository here: https://github.com/AndrewBabbitt97/ManyToMany If you run it and attempt to set a filter on the `Tags` field you get the following exception: ```bash fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111] Unhandled exception in circuit 'sbVgOBHji6R7Bnfe-vWyektx1jnmJBlvaR5lBYtSLII'. System.InvalidOperationException: No generic method 'Contains' on type 'System.Linq.Enumerable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic. at System.Linq.Expressions.Expression.FindMethod(Type type, String methodName, Type[] typeArgs, Expression[] args, BindingFlags flags) at System.Linq.Expressions.Expression.Call(Type type, String methodName, Type[] typeArguments, Expression[] arguments) at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseEnumerable(Expression instance, Type elementType, String methodName, Int32 errorPos, Type type) at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseMemberAccess(Type type, Expression expression) at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParsePrimary() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseUnary() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseArithmetic() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAdditive() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseShiftOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseComparisonOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLogicalAndOrOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIn() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAndOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseOrOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLambdaOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseNullCoalescingOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseConditionalOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.Parse(Type resultType, Boolean createParameterCtor) at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(Type delegateType, ParsingConfig parsingConfig, Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values) at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(ParsingConfig parsingConfig, Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values) at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(ParsingConfig parsingConfig, Boolean createParameterCtor, Type itType, Type resultType, String expression, Object[] values) at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where(IQueryable source, ParsingConfig config, String predicate, Object[] args) at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[TSource](IQueryable`1 source, ParsingConfig config, String predicate, Object[] args) at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[TSource](IQueryable`1 source, String predicate, Object[] args) at Radzen.QueryableExtension.Where[T](IQueryable`1 source, RadzenDataFilter`1 dataFilter) at Radzen.Blazor.RadzenDataFilter`1.get_View() at Radzen.Blazor.RadzenDataFilter`1.Filter() at Radzen.Blazor.RadzenDataFilterProperty`1.SetParametersAsync(ParameterView parameters) ``` **Expected behavior** The grid should be filtered on the selected tags in the filter. **Screenshots** ![exception](https://github.com/radzenhq/radzen-blazor/assets/2308261/9d1991f5-5765-44d7-87ea-b561971d959a) **Desktop (please complete the following information):** - OS: Windows 11 23H2 - Browser: Chrome 120 - Version: Radzen 4.23.7 (Also tested against master, same issue) **Additional context** N/A
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1086