public async Task <IActionResult> PutTodoListTbl(int id, TodoListTbl todoListTbl) { if (id != todoListTbl.Id) { return(BadRequest()); } _context.Entry(todoListTbl).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TodoListTblExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TodoListTbl> > PostTodoListTbl(TodoListTbl todoListTbl) { todoListTbl.TaskDate = DateTime.Now; _context.TodoLists.Add(todoListTbl); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTodoListTbl", new { id = todoListTbl.Id }, todoListTbl)); }