public async Task UpdateADMasterIndustryGroup(ADMasterIndustryGroup objADMasterIndustryGroup)
 {
     try
     {
         _Context.Entry(objADMasterIndustryGroup).State = EntityState.Modified;
         await _Context.SaveChangesAsync();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
 public async Task InsertADMasterIndustryGroup(ADMasterIndustryGroup objADMasterIndustryGroup)
 {
     try
     {
         _Context.ADMasterIndustryGroups.Add(objADMasterIndustryGroup);
         await _Context.SaveChangesAsync();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
        public async Task <ActionResult <MasterIndustryGroupResult> > PostADMasterIndustryGroup(ADMasterIndustryGroup objADMasterIndustryGroup)
        {
            try
            {
                await _IMasterIndustryGroupInterface.InsertADMasterIndustryGroup(objADMasterIndustryGroup);

                return(CreatedAtAction("GetADMasterIndustryGroup", new { id = objADMasterIndustryGroup.MasterIndustryGroupId }, objADMasterIndustryGroup));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        public async Task <ActionResult <MasterIndustryGroupResult> > PutADMasterIndustryGroup(long id, ADMasterIndustryGroup objADMasterIndustryGroup)
        {
            if (id != objADMasterIndustryGroup.MasterIndustryGroupId)
            {
                return(BadRequest());
            }

            try
            {
                await _IMasterIndustryGroupInterface.UpdateADMasterIndustryGroup(objADMasterIndustryGroup);

                return(_IMasterIndustryGroupInterface.GetADMasterIndustryGroupByID(id));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_IMasterIndustryGroupInterface.ADMasterIndustryGroupExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(NoContent());
        }