public async Task <ActionResult <AutorDTO> > GetAutorAsync(int id) { var autor = await autorRepository.GetAsync(id); if (autor == null) { return(NotFound()); } return(Ok(mapper.Map <AutorDTO>(autor))); }
public async Task <IActionResult> Edit(int?id) { Autor autor = new Autor(); if (id == null) { return(NotFound()); } autor = await autorRepository.GetAsync(configuration["APIAuthor:BaseUrl"], id.GetValueOrDefault()); if (autor == null) { return(NotFound()); } return(View(autor)); }