public async Task <User> AddUser(User user) { _context.Add(user); await _context.SaveChangesAsync(); return(user); }
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()); }