public async Task <ActionResult <ExtraFeature> > PostExtraFeature(ExtraFeature extraFeature) { _context.ExtraFeatures.Add(extraFeature); await _context.SaveChangesAsync(); return(CreatedAtAction("GetExtraFeature", new { id = extraFeature.Id }, extraFeature)); }
public async Task <IActionResult> PutExtraFeature(int id, ExtraFeature extraFeature) { if (id != extraFeature.Id) { return(BadRequest()); } _context.Entry(extraFeature).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ExtraFeatureExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }