コード例 #1
0
        /// <inheritdoc />
        /// <exception cref="ArgumentNullException">
        ///     <paramref name="alias" /> or <paramref name="filter" /> is null.
        /// </exception>
        public TQuery ApplyFilterOn <TAlias>
        (
            Expression <Func <TAlias> > alias,
            IQueryFilter <TAlias> filter
        )
        {
            if (alias == null)
            {
                throw new ArgumentNullException("alias");
            }

            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }

            string aliasName = ExpressionHelper.GetPropertyName(alias);

            IFilterableQuery <TAlias> filterableQuery =
                new DelegatedFilterableQuery <TAlias, TSource, TQuery>(Query, aliasName);

            filter.Apply(filterableQuery);

            return(Query);
        }
コード例 #2
0
        /// <inheritdoc />
        public IFilterableQuery <T> ApplyFilter(IQueryFilter <T> filter)
        {
            IFilterableQuery <T> filterableQuery = new WrappedFilterableQuery <T, IFilterableQuery <T> >(this);

            filter.Apply(filterableQuery);

            return(this);
        }
コード例 #3
0
        /// <inheritdoc />
        /// <exception cref="ArgumentNullException">
        ///     <paramref name="filter" /> is null.
        /// </exception>
        public TQuery ApplyFilter(IQueryFilter <TSource> filter)
        {
            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }

            IFilterableQuery <TSource> filterableQuery = new WrappedFilterableQuery <TSource, TQuery>(Query);

            filter.Apply(filterableQuery);

            return(Query);
        }