public async Task <IActionResult> PutTodoItems(long id, TodoItems todoItems) { if (id != todoItems.Id) { return(BadRequest()); } _context.Entry(todoItems).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TodoItemsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
//TODO BK check EmailAddress public async Task <IActionResult> PutUsers(long id, UsersDTO usersDTO) { if (id != usersDTO.Id) { return(BadRequest()); } Users users = usersDTO.FromDTO(); _context.Entry(users).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsersExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }