Ejemplo n.º 1
0
 public IActionResult AddChecklist(int id, [FromBody] Checklist checklist)
 {
     try
     {
         noteservice.AddChecklist(id, checklist);
         return(Created("Added new Checklist", checklist));
     }
     catch (Exception ex)
     {
         return(StatusCode(500, "Internal Server Error"));
     }
 }
Ejemplo n.º 2
0
 public IActionResult AddChecklist(int id, Checklist lstItem)
 {
     try
     {
         var result = noteService.AddChecklist(id, lstItem);
         return(Created(new Uri("api/notes/" + id, UriKind.Relative), result));
     }
     catch (ChecklistNotFoundException ex)
     {
         return(NotFound(ex));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex));
     }
 }