public async Task <IActionResult> PutOSRSAccount(Guid id, OSRSAccount oSRSAccount) { if (id != oSRSAccount.Id) { return(BadRequest()); } _context.Entry(oSRSAccount).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OSRSAccountExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <OSRSAccount> > PostOSRSAccount(OSRSAccount oSRSAccount) { oSRSAccount.Status = "Not Banned"; _context.Accounts.Add(oSRSAccount); await _context.SaveChangesAsync(); return(CreatedAtAction("GetOSRSAccount", new { id = oSRSAccount.Id }, oSRSAccount)); }