public async Task UpdateASMasterProductSize(ASMasterProductSize objADMasterProductSize) { try { _Context.Entry(objADMasterProductSize).State = EntityState.Modified; await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task InsertASMasterProductSize(ASMasterProductSize objADMasterProductSize) { try { _Context.ASMasterProductSizes.Add(objADMasterProductSize); await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task <ActionResult <MasterProductSizeResult> > PutASMasterProductSize(long id, ASMasterProductSize objADMasterProductSize) { if (id != objADMasterProductSize.MasterProductSizeId) { return(BadRequest()); } try { await _IMasterProductSizeInterface.UpdateASMasterProductSize(objADMasterProductSize); return(_IMasterProductSizeInterface.GetASMasterProductSizeByID(id)); } catch (DbUpdateConcurrencyException) { if (!_IMasterProductSizeInterface.ASMasterProductSizeExists(id)) { return(NotFound()); } else { throw; } } catch (Exception ex) { throw new Exception(ex.Message); } return(NoContent()); }
public async Task <ActionResult <MasterProductSizeResult> > PostASMasterProductSize(ASMasterProductSize objADMasterProductSize) { try { await _IMasterProductSizeInterface.InsertASMasterProductSize(objADMasterProductSize); return(CreatedAtAction("GetASMasterProductSize", new { id = objADMasterProductSize.MasterProductSizeId }, objADMasterProductSize)); } catch (Exception ex) { throw new Exception(ex.Message); } }