示例#1
0
 // 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);
 }
示例#2
0
 // 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);
 }