public async Task <IActionResult> PutPrivelegesRequests(int id, PrivelegesRequests privelegesRequests) { if (id != privelegesRequests.Id) { return(BadRequest()); } _context.Entry(privelegesRequests).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrivelegesRequestsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <PrivelegesRequests> > PostPrivelegesRequests(PrivelegesRequests privelegesRequests) { _context.privelegesRequests.Add(privelegesRequests); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPrivelegesRequests", new { id = privelegesRequests.Id }, privelegesRequests)); }