public IActionResult Delete([FromBody] TodoModel row) { using (var ctx = new TodoContex()) { ctx.TodoITem.Remove(row); ctx.SaveChanges(); return(Ok()); } }
public IActionResult Insert([FromBody] TodoModel model) { using (var ctx = new TodoContex()) { var item = ctx.TodoITem.Add(model); ctx.SaveChanges(); return(Ok(item.Entity)); } }