public async Task <ActionResult <MItemMaster> > PostMItemMaster(MItemMaster mItemMaster) { _context.MItemMaster.Add(mItemMaster); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMItemMaster", new { id = mItemMaster.Id }, mItemMaster)); }
public async Task <IActionResult> PutMItemMaster(int id, MItemMaster mItemMaster) { if (id != mItemMaster.Id) { return(BadRequest()); } _context.Entry(mItemMaster).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MItemMasterExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }