public async Task <IActionResult> Get() { try { var toMap = await _libriService.GetLibri(); var res = AnswerLibro.MappaPerLista(toMap); return(Ok(res)); } catch (Exception) { return(StatusCode(500, null)); } }
public async Task <IActionResult> Get(int id) { try { var toMap = await _libriService.GetLibro(id); if (toMap == null) { return(NotFound()); } else { return(Ok(AnswerLibro.MappaLibro(toMap))); } } catch (Exception) { return(StatusCode(500, null)); throw; } }