protected async Task <int> GetTotalPages( GuardPatrolsQuery request, CancellationToken cancellationToken) { var specification = this.GetGuardPatrolSpecification(request); return(await this.guardPatrolQueryRepository.Total( specification, cancellationToken)); }
protected async Task <IEnumerable <GuardPatrol> > GetGuardPatrolListings( GuardPatrolsQuery request, CancellationToken cancellationToken) { var specification = this.GetGuardPatrolSpecification(request); var skip = (request.Page - 1) * GuardPatrolsPerPage; return(await this.guardPatrolQueryRepository.GetGuardPatrolListings( specification, skip, GuardPatrolsPerPage, cancellationToken)); }
private Specification <GuardPatrol> GetGuardPatrolSpecification(GuardPatrolsQuery request) { return(new GuardPatrolOnlyAvailableSpecification(request.OnlyAvailable)); }