示例#1
0
 public async Task UpdateAsync(TodoModel modifiedTodo)
 {
     _context.Todos.Update(modifiedTodo);
     await _context.SaveChangesAsync();
 }
示例#2
0
 public async Task AddAsync(TodoModel newTodo)
 {
     newTodo.CreationDate = newTodo.LastEditDate = DateTime.Now;
     _context.Todos.Add(newTodo);
     await _context.SaveChangesAsync();
 }