Ejemplo n.º 1
0
        public async Task <PagingQueryResult <OrganizationPagingQueryDTO> > Handle(OrganizationPagingQuery request, CancellationToken cancellationToken)
        {
            var result = new PagingQueryResult <OrganizationPagingQueryDTO>();

            request.CheckPagingParam();
            var specification = new OrganizationPagingSpecification(request.Page, request.PageSize, request.OrderBy, request.Desc, request.Search);

            result.Count = await organizationRepository.Get(specification).CountAsync();

            var datas = await organizationRepository.Paging(specification).ToListAsync();

            result.Items = mapper.Map <List <OrganizationPagingQueryDTO> >(datas);
            return(result);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Get([FromQuery] OrganizationPagingQuery query)
        {
            var list = await _mediator.Send(query);

            return(Ok(list));
        }