public async Task <ActionResult <MItemSubGroup> > PostMItemSubGroup(MItemSubGroup mItemSubGroup) { _context.MItemSubGroup.Add(mItemSubGroup); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMItemSubGroup", new { id = mItemSubGroup.IsgId }, mItemSubGroup)); }
public async Task <IActionResult> PutMItemSubGroup(int id, MItemSubGroup mItemSubGroup) { if (id != mItemSubGroup.IsgId) { return(BadRequest()); } _context.Entry(mItemSubGroup).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MItemSubGroupExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }