public async Task UpdateADMasterIndustrySubType(ADMasterIndustrySubType objADMasterIndustrySubType) { try { _Context.Entry(objADMasterIndustrySubType).State = EntityState.Modified; await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task InsertADMasterIndustrySubType(ADMasterIndustrySubType objADMasterIndustrySubType) { try { _Context.ADMasterIndustrySubTypes.Add(objADMasterIndustrySubType); await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task <ActionResult <MasterIndustrySubTypeResult> > PostADMasterIndustrySubType(ADMasterIndustrySubType objADMasterIndustrySubType) { try { await _IMasterIndustrySubTypeInterface.InsertADMasterIndustrySubType(objADMasterIndustrySubType); return(CreatedAtAction("GetADMasterIndustrySubType", new { id = objADMasterIndustrySubType.MasterIndustrySubTypeId }, objADMasterIndustrySubType)); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task <ActionResult <MasterIndustrySubTypeResult> > PutADMasterIndustrySubType(long id, ADMasterIndustrySubType objADMasterIndustrySubType) { if (id != objADMasterIndustrySubType.MasterIndustrySubTypeId) { return(BadRequest()); } try { await _IMasterIndustrySubTypeInterface.UpdateADMasterIndustrySubType(objADMasterIndustrySubType); return(_IMasterIndustrySubTypeInterface.GetADMasterIndustrySubTypeByID(id)); } catch (DbUpdateConcurrencyException) { if (!_IMasterIndustrySubTypeInterface.ADMasterIndustrySubTypeExists(id)) { return(NotFound()); } else { throw; } } catch (Exception ex) { throw new Exception(ex.Message); } return(NoContent()); }