public async Task <Models.Employee> GetEmployeeAsync(ClearCost.Platform.Employer employer, int cchId)
        {
            if (cchId < 1)
            {
                throw new ArgumentException("Invalid member context.");
            }

            if (employer == null || string.IsNullOrEmpty(employer.ConnectionString))
            {
                throw new ArgumentException("Invalid employer context.");
            }

            _repositoryV2.Initialize(employer.ConnectionString);

            var employee = new Models.Employee();

            // Check to see if this database has data warhouse tables.
            if (await _repositoryV2.IsExistingTableAsync("dbo", "Employee_d"))
            {
                var employeeData = await _repositoryV2.GetEmployeeByCchIdAsync(cchId);

                employee.Merge(employeeData);
                if (await _repositoryV2.IsExistingTableAsync("dbo", "Member_d"))
                {
                    var memberData = await _repositoryV2.GetMemberByCchIdAsync(cchId);

                    employee.Merge(memberData);
                    if (await _repositoryV2.IsExistingTableAsync("dbo", "BenefitEnrollment_f"))
                    {
                        var medicalData = await _repositoryV2.GetEmployeeBenefitEnrollmentMedicalPlanAsync(memberData.MemberKey);

                        employee.Merge(medicalData);
                    }
                }
            }
            else
            {
                _repositoryV1 = new Data.V1.EmployeeRepository();
                _repositoryV1.Initialize(employer.ConnectionString);

                var employeeData = await _repositoryV1.GetEmployeeAsync(cchId);

                employee.Merge(employeeData);
            }


            return(employee);
        }
        public async Task <List <PlanMember> > GetEmployeeDependentsAsync(ClearCost.Platform.Employer employer, int cchId)
        {
            if (cchId < 1)
            {
                throw new ArgumentException("Invalid member context.");
            }

            if (employer == null || string.IsNullOrEmpty(employer.ConnectionString))
            {
                throw new ArgumentException("Invalid employer context.");
            }

            _repositoryV2.Initialize(employer.ConnectionString);

            var result = await _repositoryV2.GetEmployeeDependentsAsync(cchId);

            return(result);
        }