public async Task <IActionResult> PutIdea(string id, Idea idea) { if (id != idea.Id) { return(BadRequest()); } _context.Entry(idea).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { return(Conflict()); } return(NoContent()); }
public async Task UpdateAsync(User userUpdates) { _context.Users.Attach(userUpdates); _context.Entry(userUpdates).State = EntityState.Modified; await _context.SaveChangesAsync(); }