/// <inheritdoc /> public IQueryable <TResource> Apply(ModelProvider provider, IQueryable <TResource> query) { foreach (var filter in _filters) { var expression = filter.Apply(provider.Target, property => provider.TryFilter(property, out var info) ? info : throw new ArgumentException("Cannot filter selected property")); // complex filter with nothing if (expression is DefaultExpression) { continue; } var lambda = Expression.Lambda <Func <TResource, bool> >(expression, provider.Target); query = query.Where(lambda); } return(query); }