public async Task <ActionResult <MShippingLine> > PostMShippingLine(MShippingLine mShippingLine) { _context.MShippingLine.Add(mShippingLine); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMShippingLine", new { id = mShippingLine.Id }, mShippingLine)); }
public async Task <IActionResult> PutMShippingLine(int id, MShippingLine mShippingLine) { if (id != mShippingLine.Id) { return(BadRequest()); } _context.Entry(mShippingLine).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MShippingLineExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }