public PersonSpecification(GetPersonsQuery filter) { _filter = filter; }
public async Task <PagedList <PersonModel> > Handle(GetPersonsQuery request, CancellationToken cancellationToken) { var data = _unitOfWork.PersonRepository.GetAll(new PersonSpecification(request).ToExpression()); return(await PagedList <PersonModel> .Create(_unitOfWork.PersonRepository, data, request.PageNumber, request.PageSize, _mapper, cancellationToken)); }