public async Task <PagingQueryResult <FilePagingQueryDTO> > Handle(FilePagingQuery request, CancellationToken cancellationToken) { request.CheckPagingParam(); var result = new PagingQueryResult <FilePagingQueryDTO>(); var specification = new FilePagingSpecification(request.Page, request.PageSize, request.Search, request.OrderBy, request.Desc); result.Total = await fileAssetRepository.Get(specification).CountAsync(); result.Data = await fileAssetRepository.Paging(specification).Select(x => mapper.Map <FilePagingQueryDTO>(x)).ToListAsync(); return(result); }
public async Task <string> Handle(FileExistCheckQuery request, CancellationToken cancellationToken) { var url = await fileAssetRepository.Get(new CheckFileExistSpecification(request.Md5)).Select(x => x.Url).FirstOrDefaultAsync(); return(url); }