// PUT api/values/5 public void Put(int id, [FromBody]TodoItem todo) { dynamic table = new Todo(); var completed = new Nullable<DateTime>(); if (todo.IsComplete) completed = DateTime.Now; var item = new { Name = todo.Name, IsComplete = todo.IsComplete, CompletedOn = completed }; table.Update(item, id); }
// DELETE api/values/5 public void Delete(int id) { dynamic table = new Todo(); var item = new { Deleted = true, DeletedOn = DateTime.Now }; table.Update(item, id); }