public async Task <ActionResult <ToDoLista> > PostToDoLista(ToDoLista toDoLista) { _context.ToDoLista.Add(toDoLista); await _context.SaveChangesAsync(); return(CreatedAtAction("GetToDoLista", new { id = toDoLista.lista_Id }, toDoLista)); }
public async Task <IActionResult> PutToDoLista(int id, ToDoLista toDoLista) { if (id != toDoLista.lista_Id) { return(BadRequest()); } _context.Entry(toDoLista).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ToDoListaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }