Exemplo n.º 1
0
        public NHibernateConfigurator(IEnumerable <IExtensionNHibernateConfigurationProvider> extensionConfigurationProviders,
                                      IEnumerable <INHibernateBeforeBindMappingActivity> beforeBindMappingActivities,
                                      IEnumerable <INHibernateFilterConfigurator> authorizationStrategyConfigurators,
                                      IFilterCriteriaApplicatorProvider filterCriteriaApplicatorProvider,
                                      IEnumerable <INHibernateConfigurationActivity> configurationActivities,
                                      IOrmMappingFileDataProvider ormMappingFileDataProvider,
                                      IOdsDatabaseConnectionStringProvider connectionStringProvider)
        {
            _connectionStringProvider = connectionStringProvider;

            _ormMappingFileDataProvider = Preconditions.ThrowIfNull(
                ormMappingFileDataProvider, nameof(ormMappingFileDataProvider));

            _extensionConfigurationProviders = Preconditions.ThrowIfNull(
                extensionConfigurationProviders.ToArray(), nameof(extensionConfigurationProviders));

            _beforeBindMappingActivities = Preconditions.ThrowIfNull(
                beforeBindMappingActivities.ToArray(), nameof(beforeBindMappingActivities));

            _authorizationStrategyConfigurators = Preconditions.ThrowIfNull(
                authorizationStrategyConfigurators.ToArray(), nameof(authorizationStrategyConfigurators));

            _configurationActivities = Preconditions.ThrowIfNull(
                configurationActivities.ToArray(), nameof(configurationActivities));

            _filterCriteriaApplicatorProvider = Preconditions.ThrowIfNull(
                filterCriteriaApplicatorProvider, nameof(filterCriteriaApplicatorProvider));

            //Resolve all extensions to include in core mapping
            _entityExtensionHbmBagsByEntityName = _extensionConfigurationProviders
                                                  .SelectMany(x => x.EntityExtensionHbmBagByEntityName)
                                                  .GroupBy(x => x.Key)
                                                  .ToDictionary(
                x => x.Key,
                x => x.Select(y => y.Value)
                .ToArray());

            _aggregateExtensionHbmBagsByEntityName = _extensionConfigurationProviders
                                                     .SelectMany(x => x.AggregateExtensionHbmBagsByEntityName)
                                                     .GroupBy(x => x.Key)
                                                     .ToDictionary(
                x => x.Key,
                x => x.SelectMany(y => y.Value)
                .ToArray());

            _extensionDescriptorByEntityName = _extensionConfigurationProviders
                                               .SelectMany(x => x.NonDiscriminatorBasedHbmJoinedSubclassesByEntityName)
                                               .GroupBy(x => x.Key)
                                               .ToDictionary(
                x => x.Key,
                x => x.SelectMany(y => y.Value)
                .ToArray());

            _extensionDerivedEntityByEntityName = _extensionConfigurationProviders
                                                  .SelectMany(x => x.DiscriminatorBasedHbmSubclassesByEntityName)
                                                  .GroupBy(x => x.Key)
                                                  .ToDictionary(k => k.Key, v => v.SelectMany(y => y.Value).ToArray());
        }
Exemplo n.º 2
0
 public NHibernateOdsConnectionProvider(IOdsDatabaseConnectionStringProvider connectionStringProvider)
 {
     _connectionStringProvider = connectionStringProvider;
 }
Exemplo n.º 3
0
 public ImmunizationsImmunizationsPatientIdentificationProvider(IOdsDatabaseConnectionStringProvider odsDatabaseConnectionStringProvider)
 {
     _odsDatabaseConnectionStringProvider = odsDatabaseConnectionStringProvider;
 }
 public ImmunizationsWirSchoolProvider(IOdsDatabaseConnectionStringProvider odsDatabaseConnectionStringProvider)
 {
     _odsDatabaseConnectionStringProvider = odsDatabaseConnectionStringProvider;
 }
 public EdFiOdsInstanceIdentificationProvider(IOdsDatabaseConnectionStringProvider odsDatabaseConnectionStringProvider)
 {
     _odsDatabaseConnectionStringProvider = odsDatabaseConnectionStringProvider;
 }