public async Task <ActionResult <Pricedetail> > PostPricedetail(Pricedetail pricedetail) { _context.Pricedetail.Add(pricedetail); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPricedetail", new { id = pricedetail.PriceDetId }, pricedetail)); }
public async Task <IActionResult> PutPricedetail(int id, Pricedetail pricedetail) { if (id != pricedetail.PriceDetId) { return(BadRequest()); } _context.Entry(pricedetail).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PricedetailExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }