public async Task <IActionResult> PutnewFormationRequest(int id, newFormationRequest newFormationRequest) { if (id != newFormationRequest.Id) { return(BadRequest()); } _context.Entry(newFormationRequest).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!newFormationRequestExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <newFormationRequest> > PostnewFormationRequest(newFormationRequest newFormationRequest) { _context.newFormationRequests.Add(newFormationRequest); await _context.SaveChangesAsync(); return(CreatedAtAction("GetnewFormationRequest", new { id = newFormationRequest.Id }, newFormationRequest)); }