public async Task <List <OS_OrganizationStructureTemplateBusinessUnit_Dto> > GetBusinessUnitsAsync(int osId) { try { List <OS_OrganizationStructureTemplateBusinessUnit_Dto> obj = ObjectMapper.Map <List <OS_OrganizationStructureTemplateBusinessUnit>, List <OS_OrganizationStructureTemplateBusinessUnit_Dto> >(BusinessUnitsRepository.WithDetails().Where(x => x.OrganizationStructureTemplateId == osId).ToList()); return(obj); } catch (Exception ex) { return(null); } }
public async Task <OS_OrganizationStructureTemplateBusinessUnit_Dto> GetBusinessUnitAsync(int buId, int orgStructureId) { try { OS_OrganizationStructureTemplateBusinessUnit_Dto obj = ObjectMapper.Map <OS_OrganizationStructureTemplateBusinessUnit, OS_OrganizationStructureTemplateBusinessUnit_Dto>(BusinessUnitsRepository.WithDetails().FirstOrDefault(x => x.Id == buId && x.OrganizationStructureTemplateId == orgStructureId)); return(obj); } catch (Exception ex) { return(null); } }