public async Task <ActionResult <MpricingLevel> > PostMpricingLevel(MpricingLevel mpricingLevel) { _context.MpricingLevel.Add(mpricingLevel); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMpricingLevel", new { id = mpricingLevel.Id }, mpricingLevel)); }
public async Task <IActionResult> PutMpricingLevel(int id, MpricingLevel mpricingLevel) { if (id != mpricingLevel.Id) { return(BadRequest()); } _context.Entry(mpricingLevel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MpricingLevelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }