Hi,
Is it possible to use filtering with List of child objects?
Example :
User
- Guid Id
- String Name
- List<PhoneNumber> PhoneNumbers
- Adress Adress
PhoneNumber
- Guid Id
- String PhoneNumber
Adress
- Guid Id
- String Street
If i filter on the street off a Adress and in the FilterDesriptor member is "Adres.Street" than it works correctly.
But how can you do it if it is a list? Like i want to filter on the PhoneNumbers?
I already tried "PhoneNumbers.PhoneNumber", but than i got the error :
System.ArgumentException: Invalid property or field - 'PhoneNumber' for type: ICollection`1
at Kendo.Mvc.Infrastructure.Implementation.Expressions.MemberAccessTokenExtensions.CreateMemberAccessExpression(IMemberAccessToken token, Expression instance)at Kendo.Mvc.Infrastructure.Implementation.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName)
at Kendo.Mvc.Infrastructure.Implementation.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName, Boolean liftMemberAccessToNull)
at Kendo.Mvc.Infrastructure.Implementation.Expressions.PropertyAccessExpressionBuilder.CreateMemberAccessExpression()
at Kendo.Mvc.Infrastructure.Implementation.Expressions.FilterDescriptorExpressionBuilder.CreateMemberExpression()
at Kendo.Mvc.Infrastructure.Implementation.Expressions.FilterDescriptorExpressionBuilder.CreateBodyExpression()
at Kendo.Mvc.FilterDescriptor.CreateFilterExpression(ParameterExpression parameterExpression)
at Kendo.Mvc.FilterDescriptorBase.CreateFilterExpression(Expression instance)
at Kendo.Mvc.Infrastructure.Implementation.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpression()
at Kendo.Mvc.CompositeFilterDescriptor.CreateFilterExpression(ParameterExpression parameterExpression)
at Kendo.Mvc.FilterDescriptorBase.CreateFilterExpression(Expression instance)
at Kendo.Mvc.Infrastructure.Implementation.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpression()
at Kendo.Mvc.CompositeFilterDescriptor.CreateFilterExpression(ParameterExpression parameterExpression)
at Kendo.Mvc.FilterDescriptorBase.CreateFilterExpression(Expression instance)
at Kendo.Mvc.Infrastructure.Implementation.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpression()
at Kendo.Mvc.Infrastructure.Implementation.Expressions.FilterExpressionBuilder.CreateFilterExpression()
at Kendo.Mvc.Extensions.QueryableExtensions.Where(IQueryable source, IEnumerable`1 filterDescriptors)
at Kendo.Mvc.Extensions.QueryableExtensions.CreateDataSourceResult[TModel,TResult](IQueryable queryable, DataSourceRequest request, ModelStateDictionary modelState, Func`2 selector)
at Kendo.Mvc.Extensions.QueryableExtensions.ToDataSourceResult(IQueryable queryable, DataSourceRequest request, ModelStateDictionary modelState)
at Kendo.Mvc.Extensions.QueryableExtensions.ToDataSourceResult(IQueryable queryable, DataSourceRequest request)
at Kendo.Mvc.Extensions.QueryableExtensions.<>c__DisplayClass9_0.<ToDataSourceResultAsync>b__0()
Greetings,
Maxime