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()); }