public async Task <IActionResult> PutEfourQuadrantChopper(short id, EfourQuadrantChopper efourQuadrantChopper) { if (id != efourQuadrantChopper.EfourQuadrantChopperId) { return(BadRequest()); } _context.Entry(efourQuadrantChopper).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EfourQuadrantChopperExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <EfourQuadrantChopper> > PostEfourQuadrantChopper(EfourQuadrantChopper efourQuadrantChopper) { _context.EfourQuadrantChopper.Add(efourQuadrantChopper); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (EfourQuadrantChopperExists(efourQuadrantChopper.EfourQuadrantChopperId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetEfourQuadrantChopper", new { id = efourQuadrantChopper.EfourQuadrantChopperId }, efourQuadrantChopper)); }