public static IRepository <T> GetRepository <T>(ccEntities context) where T : class
        {
            IRepository <T> result = null;

            if (typeof(T) == typeof(Client))
            {
                result = new ClientsRepository(context) as IRepository <T>;
            }
            else if (typeof(T) == typeof(Agency))
            {
                result = new AgenciesRepository(context) as IRepository <T>;
            }
            else
            {
                result = new Repository <T>(context);
            }
            return(result);
        }
 private void CreateRepositories(ccEntities dataContext)
 {
     Clients = new ClientsRepository(dataContext, this);
     HomeCareEntitledPeriods = new HomeCareEntitledPeriodsRepository(dataContext, this);
     FundStatuses            = new Repository <FundStatus>(dataContext, this);
     Agencies                  = new AgenciesRepository(dataContext);
     AgencyGroups              = new AgencyGroupsRepository(dataContext);
     ApprovalStatuses          = new Repository <ApprovalStatus>(dataContext);
     Users                     = new Repository <User>(dataContext);
     FunctionalityScores       = new FunctionalityScoresRepository(dataContext, this);
     FunctionalityLevels       = new Repository <FunctionalityLevel>(dataContext);
     Countries                 = new Repository <Country>(dataContext);
     States                    = new Repository <State>(dataContext);
     NationalIdTypes           = new Repository <NationalIdType>(dataContext);
     LeaveReasons              = new Repository <LeaveReason>(dataContext);
     Histories                 = new Repository <History>(dataContext);
     Regions                   = new Repository <Region>(dataContext);
     DccSubsides               = new Repository <DccSubside>(dataContext);
     CommunicationsPreferences = new Repository <CommunicationsPreference>(dataContext);
     CareReceivingOptions      = new Repository <CareReceivingOption>(dataContext);
 }