public async Task <ActionResult <XbrainUser> > PostXbrainUser(XbrainUser xbrainUser) { _context.XbrainUser.Add(xbrainUser); await _context.SaveChangesAsync(); return(CreatedAtAction("GetXbrainUser", new { id = xbrainUser.Id }, xbrainUser)); }
public async Task <IActionResult> PutXbrainUser(int id, XbrainUser xbrainUser) { if (id != xbrainUser.Id) { return(BadRequest()); } _context.Entry(xbrainUser).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!XbrainUserExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }