public async Task <Response> Handle(ListAllAcademicsRequest request, CancellationToken cancellationToken)
        {
            if (request == null)
            {
                AddNotification("Request", "A requisição é inválida!");
                return(new Response(this));
            }

            if (IsInvalid())
            {
                return(new Response(this));
            }

            List <Entities.Academic> academics = _academicRepository.GetAll(request.PageParameters);
            int count          = _academicRepository.GetAcademicsCount();
            var paginationInfo = new PagedList <Entities.Academic>(academics, count,
                                                                   request.PageParameters.PageNumber, request.PageParameters.PageSize);

            var response = new Response(this, academics, paginationInfo);

            return(await Task.FromResult(response));
        }
示例#2
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public IEnumerable <Academic> GetAcademics()
 {
     return(academicRepository.GetAll());
 }