public async Task <ActionResult <LaptopFeatures> > PostLaptopFeatures(LaptopFeatures laptopFeatures) { _context.LaptopFeatures.Add(laptopFeatures); await _context.SaveChangesAsync(); return(CreatedAtAction("GetLaptopFeatures", new { id = laptopFeatures.Id }, laptopFeatures)); }
public async Task <IActionResult> PutLaptopFeatures(int id, LaptopFeatures laptopFeatures) { if (id != laptopFeatures.Id) { return(BadRequest()); } _context.Entry(laptopFeatures).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LaptopFeaturesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }