public async Task <ActionResult <PaginationResponse <PaymentDto> > > GetPaymentsWithPagination([FromQuery] GetPaymentsWithPaginationQuery query)
 {
     return(await Mediator.Send(query));
 }
        public async Task <PaginationResponse <PaymentDto> > GetPaymentsWithPaginationQuery(GetPaymentsWithPaginationQuery request)
        {
            PaginatedList <PaymentDto> list = await Entity
                                              .AsNoTracking()
                                              .Where(x => x.Name.Contains(request.SearchText))
                                              .OrderBy(x => x.Name)
                                              .ProjectTo <PaymentDto>(_mapper.ConfigurationProvider)
                                              .PaginatedListAsync(request.PageNumber, request.PageSize);


            return(new PaginationResponse <PaymentDto>
            {
                Items = list,
                PageIndex = list.PageIndex,
                TotalPages = list.TotalPages,
                TotalCount = list.TotalCount,
            });
        }