protected async Task <int> GetTotalPages( GuardTaskQuery request, CancellationToken cancellationToken) { var specification = this.GetGuardTaskSpecification(request); return(await this.guardTaskQueryRepository.Total( specification, cancellationToken)); }
protected async Task <IEnumerable <GuardTask> > GetGuardTaskListings( GuardTaskQuery request, CancellationToken cancellationToken) { var specification = this.GetGuardTaskSpecification(request); var skip = (request.Page - 1) * GuardTasksPerPage; return(await this.guardTaskQueryRepository.GetGuardTaskListings( specification, skip, GuardTasksPerPage, cancellationToken)); }
private Specification <GuardTask> GetGuardTaskSpecification(GuardTaskQuery request) { return(new GuardTaskByStateSpecification(request.State) .And(new GuardTaskByGuardPatrolSpecification(request.GuardPatrolId))); }