Ejemplo n.º 1
0
        public async Task <IActionResult> GetLanguages([FromQuery] GetAllProgrammingLanguagesPaginatedQuery query)
        {
            var languages = await Mediator.Send(query);

            var languagesWithLinks = languages.Select(language =>
                                                      new HateoasResponse <ProgrammingLanguageNavigation>(language, GetLinksForLanguage(language.Id)));

            return(Ok(HateoasResponseBuilder.FromPagedList(
                          Url,
                          languages.ToPagedListResume(),
                          languagesWithLinks.ToList(),
                          nameof(GetLanguages))
                      ));
        }
 public Task <IPagedList <ProgrammingLanguageNavigation> > Handle(GetAllProgrammingLanguagesPaginatedQuery request,
                                                                  CancellationToken cancellationToken)
 {
     return(_readProgrammingLanguageRepository.GetAllLanguageNavigationPaginated(request));
 }