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

            request.CheckPagingParam();

            var clientOrganId = await clientAssetPermissionControlService.ClientAssetOrganIdRedirection();

            var specification = new MapPagingSpecification(clientOrganId, request.Page, request.PageSize, request.Search);
            var datas         = await mapRepository.Paging(specification).Select(x => new { x.Id, x.Name, x.CreatedTime, x.ModifiedTime }).ToListAsync();

            result.Total = await mapRepository.Get(specification).CountAsync();

            result.Data = datas.Select(x => MapPagingQueryDTO.From(x.Id, x.Name, x.CreatedTime, x.ModifiedTime)).ToList();
            return(result);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Get([FromQuery] MapPagingQuery query)
        {
            var list = await _mediator.Send(query);

            return(Ok(list));
        }