Exemplo n.º 1
0
        public PlainDataTableResult(IQueryable <TSource> query, IFilterRequest request, OutputType?outputType = null)
            : base(outputType)
        {
            IDataTableFilterProcessor filterProcessor = new DataTableFilterProcessor();
            IDataTableProcessor       processor       = new DataTableProcessor(filterProcessor);

            this.Data = processor.Process(query, request);
        }
        // POST api/values
        public IHttpActionResult Post([FromBody] FilterRequest filter)
        {
            IDataTableFilterProcessor   filterProcessor = new DataTableFilterProcessor();
            IDataTableProcessor         processor       = new DataTableProcessor(filterProcessor);
            IPageResponse <UserProfile> response        = processor.Process(UserProfiles.AsQueryable(), filter,
                                                                            (x) => x.Where(y => y.BirthDate > new DateTime(2014, 01, 01)));

            return(Ok(response));
        }
        // POST api/values
        //public void Post([FromBody]UserProfile userProfile)
        //{
        //    UserProfiles.Add(userProfile);
        //}

        // POST api/values
        public IHttpActionResult Post([FromBody]FilterRequest filter)
        {
            IDataTableFilterProcessor filterProcessor = new DataTableFilterProcessor();
            IDataTableProcessor processor = new DataTableProcessor(filterProcessor);
            IPageResponse<UserProfile> response = processor.Process(UserProfiles.AsQueryable(), filter,
                (x) => x.Where(y => y.BirthDate > new DateTime(2014, 01, 01)));

            return Ok(response);
        }
Exemplo n.º 4
0
        public MutableDataTableResult(IQueryable <object> query, IFilterRequest request, OutputType?outputType = null)
            : base(outputType)
        {
            IDataTableFilterProcessor filterProcessor = new DataTableFilterProcessor();
            IDataTableProcessor       processor       = new DataTableProcessor(filterProcessor);
            IPageResponse <object>    response        = processor.Process(query, request);

            this.Data = response;
        }