public async Task <IActionResult> PutTodoItem(long id, TodoItemDTO todoItemDTO) { if (id != todoItemDTO.Id) { return(BadRequest()); } _context.Entry(todoItemDTO).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TodoItemExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void CommitAsync() { dataContext.SaveChangesAsync(); }