Esempio n. 1
0
        public async Task <Pageable <OrderDto> > SearchAsync(OrderQuerySearch querySearch)
        {
            var query = _applicationContext.GetQuery <Order>(querySearch).ProjectTo <OrderDto>(_mapper.ConfigurationProvider);

            var totalItem = query.Count();

            var items = await query.ApplyPaging(querySearch.GetSkip(), querySearch.GetTake()).ToListAsync();

            return(new Pageable <OrderDto>(totalItem, querySearch.GetTake(), querySearch.PageIndex, items));
        }
Esempio n. 2
0
 public async Task <IActionResult> Get([FromQuery] OrderQuerySearch querySearch)
 => Ok(await _service.SearchAsync(querySearch));