コード例 #1
0
        public IQueryable <School> BuildEntityQuery(IReFilterRequest filterRequest)
        {
            var query = SchoolServiceTestData.Schools.AsQueryable();

            query = BuildFilteredQuery(query, filterRequest);

            return(query);
        }
コード例 #2
0
        public List <int> GetForeignKeys(IReFilterRequest filterRequest)
        {
            var query = SchoolServiceTestData.Schools.AsQueryable();

            query = BuildFilteredQuery(query, filterRequest);

            return(query.Select(e => e.Id)
                   .Distinct()
                   .ToList());
        }
コード例 #3
0
        public IQueryable <School> BuildFilteredQuery(IQueryable <School> query, IReFilterRequest filterRequest)
        {
            var filters = GetFilters(filterRequest).ToList();

            filters.ForEach(filter =>
            {
                query = filter.FilterQuery(query);
            });

            return(query);
        }
コード例 #4
0
        public IEnumerable <IReFilter <School> > GetFilters(IReFilterRequest filterRequest)
        {
            List <IReFilter <School> > filters = new List <IReFilter <School> >();

            if (filterRequest == null)
            {
                return(filters);
            }

            var realFilter = (SchoolFilterRequest)filterRequest;

            //if (!string.IsNullOrWhiteSpace(realFilter.Name))
            //{
            //    filters.Add(new NameFilter(realFilter.Name));
            //}

            return(filters);
        }