Ejemplo n.º 1
0
 public DbConfigurationManager(DbConfigurationLoader loader, DbConfigurationFinder finder)
 {
     this._loader        = loader;
     this._finder        = finder;
     this._configuration = new Lazy <InternalConfiguration>((Func <InternalConfiguration>)(() =>
     {
         DbConfiguration dbConfiguration = this._newConfiguration ?? this._newConfigurationType.CreateInstance <DbConfiguration>(new Func <string, string, string>(Strings.CreateInstance_BadDbConfigurationType), (Func <string, Exception>)null);
         dbConfiguration.InternalConfiguration.Lock();
         return(dbConfiguration.InternalConfiguration);
     }));
 }
        public DbConfigurationManager(DbConfigurationLoader loader, DbConfigurationFinder finder)
        {
            DebugCheck.NotNull(loader);
            DebugCheck.NotNull(finder);

            _loader        = loader;
            _finder        = finder;
            _configuration = new Lazy <InternalConfiguration>(
                () =>
            {
                var configuration = _newConfiguration
                                    ?? _newConfigurationType.CreateInstance <DbConfiguration>(
                    Strings.CreateInstance_BadDbConfigurationType);
                configuration.InternalConfiguration.Lock();
                return(configuration.InternalConfiguration);
            });
        }
        public DbConfigurationManager(DbConfigurationLoader loader, DbConfigurationFinder finder)
        {
            DebugCheck.NotNull(loader);
            DebugCheck.NotNull(finder);

            _loader = loader;
            _finder = finder;
            _configuration = new Lazy<InternalConfiguration>(
                () =>
                    {
                        var configuration = _newConfiguration
                                            ?? _newConfigurationType.CreateInstance<DbConfiguration>(
                                                Strings.CreateInstance_BadDbConfigurationType);
                        configuration.InternalConfiguration.Lock();
                        return configuration.InternalConfiguration;
                    });
        }
Ejemplo n.º 4
0
        public DbConfigurationManager(DbConfigurationLoader loader, DbConfigurationFinder finder)
        {
            DebugCheck.NotNull(loader);
            DebugCheck.NotNull(finder);

            _loader        = loader;
            _finder        = finder;
            _configuration = new Lazy <InternalConfiguration>(
                () =>
            {
                var configuration = _newConfiguration
                                    ?? _newConfigurationType.CreateInstance <DbConfiguration>(
                    Strings.CreateInstance_BadDbConfigurationType);

                foreach (var handler in _loader.GetOnLoadedHandlers(AppConfig.DefaultInstance))
                {
                    configuration.InternalConfiguration.AddOnLoadedHandler(handler);
                }

                configuration.InternalConfiguration.Lock();
                return(configuration.InternalConfiguration);
            });
        }