Пример #1
0
        /// <summary>Creates a new instance of the <see cref="ConfigurationBuilder"/>.</summary>
        public ConfigurationBuilder(IDefinitionProvider[] definitionProviders, ClassMappingGenerator generator, IWebContext webContext, ConfigurationBuilderParticipator[] participators, DatabaseSection config, ConnectionStringsSection connectionStrings)
        {
            this.definitionProviders = definitionProviders;
            this.generator = generator;
            this.webContext = webContext;
            this.participators = participators;

            if (config == null) config = new DatabaseSection();
            TryLocatingHbmResources = config.TryLocatingHbmResources;
            tablePrefix = config.TablePrefix;
            batchSize = config.BatchSize;
            childrenLaziness = config.ChildrenLaziness;

            SetupProperties(config, connectionStrings);
            SetupMappings(config);
        }
Пример #2
0
        /// <summary>Creates a new instance of the <see cref="ConfigurationBuilder"/>.</summary>
        public ConfigurationBuilder(IDefinitionManager definitions, ClassMappingGenerator generator, IWebContext webContext, ConfigurationBuilderParticipator[] participators, DatabaseSection config, ConnectionStringsSection connectionStrings)
        {
            this.definitions = definitions;
            this.generator = generator;
            this.webContext = webContext;
            this.participators = participators;

            if (config == null) config = new DatabaseSection();

            if (!string.IsNullOrEmpty(config.HibernateMapping))
                DefaultMapping = config.HibernateMapping;

            SetupProperties(config, connectionStrings);
            SetupMappings(config);

            TryLocatingHbmResources = config.TryLocatingHbmResources;
            tablePrefix = config.TablePrefix;
            batchSize = config.BatchSize;
            childrenLaziness = config.ChildrenLaziness;
        }