Example #1
0
 public SessionProvider(IConfigurationBuilder builder, IInterceptor interceptor, IWebContext webContext)
 {
     nhSessionFactory = builder.BuildSessionFactory();
     Debug.WriteLine("Built Session Factory " + DateTime.Now);
     this.webContext = webContext;
     this.interceptor = interceptor;
 }
Example #2
0
		public SessionProvider(IConfigurationBuilder builder, NHInterceptorFactory interceptorFactory, IWebContext webContext, DatabaseSection config)
		{
			nhSessionFactory = builder.BuildSessionFactory();
			this.webContext = webContext;
			this.interceptorFactory = interceptorFactory;
			this.isolation = config.Isolation;
		}
Example #3
0
        public SessionProvider(IConfigurationBuilder configurationBuilder, INotifyingInterceptor interceptor, IWebContext webContext)
        {
            //HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize();

            _sessionFactory = configurationBuilder.Configuration.BuildSessionFactory();
            _interceptor = interceptor;
            _webContext = webContext;
        }
Example #4
0
 public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv)
 {
     configurationBuilder = new ConfigurationBuilder();
     configurationBuilder.SetBasePath(appEnv.ApplicationBasePath);
     configurationBuilder
         .AddJsonFile("config.json")
         .AddJsonFile($"config.{env.EnvironmentName}.json", optional: true);
 }
Example #5
0
		public override void OnSetUp()
		{
			var configurationStore = new DefaultConfigurationStore();
			var resource = new AssemblyResource("Castle.Facilities.NHibernateIntegration.Tests/Issues/Facilities116/facility.xml");
			var xmlInterpreter = new XmlInterpreter(resource);
			xmlInterpreter.ProcessResource(resource, configurationStore);
			configuration = configurationStore.GetFacilityConfiguration("nhibernatefacility").Children["factory"];
			configurationBuilder = new PersistentConfigurationBuilder();
		}
Example #6
0
		public SessionProvider(IConfigurationBuilder builder, NHInterceptorFactory interceptorFactory, IWebContext webContext, DatabaseSection config)
		{
			nhSessionFactory = builder.BuildSessionFactory();
			this.webContext = webContext;
			this.interceptorFactory = interceptorFactory;
			this.isolation = config.Isolation;
			this.autoStartTransaction = config.AutoStartTransaction;
			this.CacheEnabled = config.Caching;
		}
Example #7
0
        public Program(IApplicationEnvironment env, IServiceCollection services)
        {
            bldr = new ConfigurationBuilder(env.ApplicationBasePath).AddJsonFile("config.json");

            bldr.AddEnvironmentVariables("bETL");

            ConfigureServices();

            ServBot = svc.BuildServiceProvider();
        }
Example #8
0
 public InstallationManager(IHost host, IDefinitionManager definitions, Importer importer, IPersister persister, ISessionProvider sessionProvider, IConfigurationBuilder configurationBuilder, IWebContext webContext)
 {
     this.host = host;
     this.definitions = definitions;
     this.importer = importer;
     this.persister = persister;
     this.sessionProvider = sessionProvider;
     this.configurationBuilder = configurationBuilder;
     this.webContext = webContext;
 }
 public InstallationManager(IHost host, DefinitionMap map, ContentActivator activator, Importer importer, IPersister persister, ISessionProvider sessionProvider, IConfigurationBuilder configurationBuilder, IWebContext webContext)
 {
     this.host = host;
     this.map = map;
     this.activator = activator;
     this.importer = importer;
     this.persister = persister;
     this.sessionProvider = sessionProvider;
     this.configurationBuilder = configurationBuilder;
     this.webContext = webContext;
 }
Example #10
0
		public InstallationManager(IHost host, DefinitionMap map, ContentActivator activator, Importer importer, IPersister persister, ISessionProvider sessionProvider, IConfigurationBuilder configurationBuilder, IWebContext webContext, ConnectionMonitor connectionContext, DatabaseSection config)
		{
			this.host = host;
			this.map = map;
			this.activator = activator;
			this.importer = importer;
			this.persister = persister;
			this.sessionProvider = sessionProvider;
			this.configurationBuilder = configurationBuilder;
			this.webContext = webContext;
			this.connectionContext = connectionContext;
			this.isDatabaseFileSystemEnbled = config.Files.StorageLocation == FileStoreLocation.Database;
		}
Example #11
0
 public static void AddConfiguration(IConfigurationBuilder conf, IDictionary<string, string> settings)
 {
     foreach (KeyValuePair<string, string> kv in settings)
     {
         try
         {
             conf.Bind(kv.Key, kv.Value);
         }
         catch (BindException e)
         {
             throw new BindException("Failed to process configuration tuple: [" + kv.Key + "=" + kv.Value + "]", e);
         }
         catch (ClassHierarchyException e)
         {
             throw new ClassHierarchyException("Failed to process configuration tuple: [" + kv.Key + "=" + kv.Value + "]", e);
         }
     }
 }
Example #12
0
        public static string ResolveConfigurationFilePath(IConfigurationBuilder configuration, string path)
        {
            if (!Path.IsPathRooted(path))
            {
                if (configuration.BasePath == null)
                {
                    throw new InvalidOperationException(Resources.FormatError_MissingBasePath(
                        path,
                        typeof(IConfigurationBuilder).Name,
                        nameof(configuration.BasePath)));
                }
                else
                {
                    path = Path.Combine(configuration.BasePath, path);
                }
            }

            return path;
        }
 public IConfigurationProvider Build(IConfigurationBuilder builder)
 {
     return new EntityFrameworkConfigurationProvider(NameOrConnectionString);
 }
Example #14
0
        public static void ProcessConfigData(IConfigurationBuilder conf, IDictionary<string, string> settings)
        {
            IList<KeyValuePair<string, string>> list = new List<KeyValuePair<string, string>>();

            foreach (KeyValuePair<string, string> kv in settings)
            {
                list.Add(kv);
            }

            ProcessConfigData(conf, list);
        }
Example #15
0
 private static void BuildConfiguration(WebHostBuilderContext context, IConfigurationBuilder builder)
 {
     builder.AddJsonFile("appsettings.json")
     .AddJsonFile($"appsettings.{context.HostingEnvironment.EnvironmentName}.json", true)
     .AddEnvironmentVariables();
 }
Example #16
0
 public IConfigurationProvider Build(IConfigurationBuilder builder)
 {
     return(new EnvFileConfigurationProvider(this._envFile));
 }
Example #17
0
        private static void AddConfiguration(IConfigurationBuilder conf, StreamReader reader)
        {
            IList<KeyValuePair<string, string>> settings = new List<KeyValuePair<string, string>>();

            while (!reader.EndOfStream)
            {
                string line = reader.ReadLine();
                string[] p = line.Split('=');
                if (p.Length == 2)
                {
                    settings.Add(new KeyValuePair<string, string>(GetAssemblyName(p[0]), GetAssemblyName(p[1])));
                } 
                else if (p.Length > 2)
                {
                    string v = line.Substring(p[0].Length + 1, line.Length - p[0].Length - 1);
                    settings.Add(new KeyValuePair<string, string>(GetAssemblyName(p[0]), GetAssemblyName(v)));
                }
                else
                {
                    var e = new ApplicationException("Config data is not in format of KeyValuePair: " + line);
                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
                }  
            }
            ProcessConfigData(conf, settings);
        }
Example #18
0
 private static void SetupConfiguration(WebHostBuilderContext ctx, IConfigurationBuilder builder)
 {
     builder.Sources.Clear();
     builder.AddJsonFile("config.json", false, true);
     throw new NotImplementedException();
 }
 public IConfigurationProvider Build(IConfigurationBuilder builder)
 {
     return(new OpenImisConfigurationProvider(
                _secretsMode,
                _pathEnvironmentVariables));
 }
Example #20
0
 public IConfigurationProvider Build(IConfigurationBuilder builder)
 {
     return(new AzureTableStorageConfigurationProvider(_connection, _appName, _environment, _version));
 }
Example #21
0
 public static IConfigurationBuilder AddIf(this IConfigurationBuilder app, bool include, Func <IConfigurationBuilder, IConfigurationBuilder> action)
 {
     return(include ? action(app) : app);
 }
 public static void Configuration(this IConfigurationBuilder builder, HostBuilderContext context)
 => builder
 .AddJsonFile($"appsettings.{context.HostingEnvironment.EnvironmentName}.json")
 .AddEnvironmentVariables();
 /// <summary>
 /// Configures the application configuration.
 /// </summary>
 /// <param name="builder">The builder.</param>
 public void ConfigureAppConfiguration(IConfigurationBuilder builder)
 {
 }
Example #24
0
 public override void ConfigureAppConfiguration(TenantBuilderContext context, IConfigurationBuilder builder)
 {
 }
 public override IConfigurationProvider Build(IConfigurationBuilder builder)
 {
     FileProvider = FileProvider ?? builder.GetFileProvider();
     return(new CacheConfigurationProvider(this));
 }
 public static IConfigurationBuilder AddHttpConfiguration(
     this IConfigurationBuilder builder)
 {
     return(builder.Add(new HttpConfigSource()));
 }
 public IConfigurationProvider Build(IConfigurationBuilder builder)
 {
     return new VcapServicesConfigurationProvider(this);
 }
 /// <summary>
 /// Builds the <see cref="MessagingConfigurationProvider"/> for this source.
 /// </summary>
 /// <param name="builder">The <see cref="IConfigurationBuilder"/>.</param>
 /// <returns>A <see cref=" MessagingConfigurationProvider"/>.</returns>
 public IConfigurationProvider Build(IConfigurationBuilder builder) => _cachedProvider.Value;
Example #29
0
 public FakeSessionProvider(IConfigurationBuilder builder, IInterceptor interceptor, IWebContext webContext)
     : base(builder, interceptor, webContext)
 {
     this.interceptor = interceptor;
 }
Example #30
0
 public static void Configure(IConfigurationBuilder configuration)
 {
     // Add additional configuration here.
 }
Example #31
0
        public IConfigurationProvider Build(IConfigurationBuilder builder)
        {
            string filepath = builder.GetFileProvider().GetFileInfo(FilePath).PhysicalPath;

            return(new TextConfigurationProvider(filepath));
        }
Example #32
0
 public void SetUp()
 {
     builderMock = Mock.Of <IConfigurationBuilder>();
 }
Example #33
0
 private static IConfigurationBuilder PrepareConfiguration(IConfigurationBuilder configurationBuilder)
 {
     return(configurationBuilder
            .SetBasePath(Directory.GetCurrentDirectory())
            .AddJsonFile("appsettings.json", optional: false));
 }
 /// <inheritdoc />
 public IConfigurationProvider Build(IConfigurationBuilder builder)
 {
     return(new DaprSecretStoreConfigurationProvider(Store, SecretDescriptors, Client));
 }
Example #35
0
 /// <summary>
 /// Use the KickStart extension to configure AutoMapper.
 /// </summary>
 /// <param name="configurationBuilder">The configuration builder.</param>
 /// <returns>
 /// A fluent <see langword="interface"/> to configure KickStart.
 /// </returns>
 /// <example>Configure AutoMapper on application startup
 /// <code><![CDATA[
 /// Kick.Start(config => config
 ///     .IncludeAssemblyFor<UserProfile>()
 ///     .UseAutoMapper()
 ///     .LogLevel(TraceLevel.Verbose)
 /// );]]></code>
 /// </example>
 public static IConfigurationBuilder UseAutoMapper(this IConfigurationBuilder configurationBuilder)
 {
     return(UseAutoMapper(configurationBuilder, null));
 }
Example #36
0
 public FakeSessionProvider(IConfigurationBuilder builder, NHInterceptorFactory factory, IWebContext webContext)
     : base(builder, factory, webContext, new N2.Configuration.DatabaseSection())
 {
     this.factory = factory;
 }
Example #37
0
 public static void AddConfigurationFromString(IConfigurationBuilder conf, string configData)
 {
     byte[] array = Encoding.ASCII.GetBytes(configData);
     AddConfigurationFromStream(conf, array);
 }
Example #38
0
        private static void configureAppConfiguration(HostBuilderContext hostContext, IConfigurationBuilder configBuilder)
        {
            configBuilder
            .AddJsonFile("appsettings.json", false)
            .AddEnvironmentVariables();

            // Custom connection string from environment variable, key: CUSTOMCONNSTR_RabbitMQ.
        }
Example #39
0
 public static void ProcessConfigData(IConfigurationBuilder conf, IList<KeyValuePair<string, string>> settings)
 {
     foreach (KeyValuePair<string, string> kv in settings)
     {
         try
         {
             conf.Bind(kv.Key, kv.Value);
         }
         catch (BindException ex)
         {
             Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(ex, Level.Error, LOGGER);
             var e = new BindException("Failed to process configuration tuple: [" + kv.Key + "=" + kv.Value + "]", ex);
             Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
         }
         catch (ClassHierarchyException ex)
         {
             Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(ex, Level.Error, LOGGER);
             var e = new ClassHierarchyException("Failed to process configuration tuple: [" + kv.Key + "=" + kv.Value + "]", ex);
             Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
         }
     }
 }
 public PrefixConfigurationProvider(IConfigurationBuilder builder, string prefix) {
     _builder = builder;
     _prefix = prefix;
 }
Example #41
0
 private static void SetupConfiguration(WebHostBuilderContext web, IConfigurationBuilder builder)
 {
     builder.Sources.Clear();
     builder.AddJsonFile("config.json", false, true)
     .AddEnvironmentVariables();
 }
 public IConfigurationProvider Build(IConfigurationBuilder builder)
 {
     return(new EntityFrameworkConfigurationProvider(_optionsAction));
 }
		public TestConfigurationBuilder()
		{
			defaultConfigurationBuilder = new DefaultConfigurationBuilder();
		}
Example #44
0
        public Startup(IConfigurationBuilder configuration)
        {
            var builder = new ConfigurationBuilder().AddJsonFile("appsettings.json");

            Configuration = builder.Build();
        }
Example #45
0
 public static void AddConfiguration(IConfigurationBuilder conf, string fileName)
 {
     IDictionary<string, string> settings = ReadFromFile(fileName);
     AddConfiguration(conf, settings);
 }
 /// <summary>
 /// Adds the AWS Elastic Beanstalk IIS Env configuration provider to <paramref name="builder"/>.
 /// </summary>
 /// <param name="builder">The <see cref="IConfigurationBuilder"/> to add to.</param>
 /// <param name="optional">Whether the underlying "container configuration" file is optional.</param>
 /// <param name="reloadOnChange">Whether the configuration should be reloaded if the underlying "container configuration" file changes.</param>
 /// <returns>The <see cref="IConfigurationBuilder"/>.</returns>
 public static IConfigurationBuilder AddAwsElasticBeanstalkIisEnvConfiguration(this IConfigurationBuilder builder, bool optional, bool reloadOnChange)
 {
     return(AddAwsElasticBeanstalkIisEnvConfiguration(builder, provider: null, optional: optional, reloadOnChange: reloadOnChange));
 }
Example #47
0
 public NHInterceptor(IProxyFactory interceptor, IConfigurationBuilder builder, IItemNotifier notifier)
 {
     this.interceptor = interceptor;
     this.sessionFactory = builder.BuildSessionFactory();
     this.notifier = notifier;
 }
        /// <summary>
        /// Adds an AWS Elastic Beanstalk IIS Env configuration source to <paramref name="builder"/>.
        /// </summary>
        /// <param name="builder">The <see cref="IConfigurationBuilder"/> to add to.</param>
        /// <param name="provider">The <see cref="IFileProvider"/> to use to access the underlying "container configuration" file.</param>
        /// <param name="optional">Whether the underlying "container configuration" file is optional.</param>
        /// <param name="reloadOnChange">Whether the configuration should be reloaded if the underlying "container configuration" file changes.</param>
        /// <returns>The <see cref="IConfigurationBuilder"/>.</returns>
        public static IConfigurationBuilder AddAwsElasticBeanstalkIisEnvConfiguration(this IConfigurationBuilder builder, IFileProvider provider, bool optional, bool reloadOnChange)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            return(builder.AddAwsElasticBeanstalkIisEnvConfiguration(s =>
            {
                s.FileProvider = provider;
                s.Path = JsonFilePath;
                s.Optional = optional;
                s.ReloadOnChange = reloadOnChange;
                s.ResolveFileProvider();
            }));
        }
 public SessionFactory(IConfigurationBuilder configurationBuilder, ISessionStorageContainer sessionStorageContainer)
 {
     _configurationBuilder = configurationBuilder;
     _sessionStorageContainer = sessionStorageContainer;
 }
 /// <summary>
 /// Adds an AWS Elastic Beanstalk IIS Env configuration source to <paramref name="builder"/>.
 /// </summary>
 /// <param name="builder">The <see cref="IConfigurationBuilder"/> to add to.</param>
 /// <param name="configureSource">Configures the source.</param>
 /// <returns>The <see cref="IConfigurationBuilder"/>.</returns>
 public static IConfigurationBuilder AddAwsElasticBeanstalkIisEnvConfiguration(this IConfigurationBuilder builder, Action <AwsElasticBeanstalkContainerConfigurationConfigurationSource> configureSource)
 => builder.Add(configureSource);
        private IConfiguration AddFromAvro(IConfigurationBuilder cb, AvroConfiguration avroConfiguration)
        {
            IList<KeyValuePair<string, string>> settings = new List<KeyValuePair<string, string>>();

            foreach (ConfigurationEntry e in avroConfiguration.Bindings)
            {
                settings.Add(new KeyValuePair<string, string>(e.key, e.value));
            }
            ConfigurationFile.ProcessConfigData(cb, settings);   //TODO
            return cb.Build();
        }
 /// <summary>
 /// Builds the <see cref="TamlStreamConfigurationProvider"/> for this source.
 /// </summary>
 /// <param name="builder">The <see cref="IConfigurationBuilder"/>.</param>
 /// <returns>An <see cref="TamlStreamConfigurationProvider"/></returns>
 public override IConfigurationProvider Build(IConfigurationBuilder builder)
 => new TamlStreamConfigurationProvider(this);
Example #53
0
		public RavenInstallationManager(IHost host, DefinitionMap map, ContentActivator activator, Importer importer, IPersister persister, ISessionProvider sessionProvider, IConfigurationBuilder configurationBuilder, IWebContext webContext, ConnectionMonitor connectionContext, DatabaseSection config, RavenConnectionProvider cp)
			: base(connectionContext, importer, webContext, persister, activator)
		{
			this.cp = cp;
		}
 /// <summary>
 /// Adds the JSON configuration source at <paramref name="path"/> to <paramref name="configuraton"/>.
 /// </summary>
 /// <param name="configuration">The <see cref="IConfigurationBuilder"/> to add to.</param>
 /// <param name="path">Absolute path or path relative to <see cref="IConfigurationBuilder.BasePath"/> of
 /// <paramref name="configuration"/>.</param>
 /// <returns>The <see cref="IConfigurationBuilder"/>.</returns>
 public static IConfigurationBuilder AddJsonFile(
     [NotNull] this IConfigurationBuilder configuration,
     string path)
 {
     return(AddJsonFile(configuration, path, optional: false));
 }
Example #55
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Configuration"/> class.
 /// </summary>
 public Configuration(IConfigurationBuilder<IConfiguration> builder) {
   properties_ = builder.Properties;
   repositories_ = builder.Repositories;
   providers_ = builder.Providers;
   xml_elements_ = builder.XmlElements;
 }
        public IConfigurationProvider Build(IConfigurationBuilder builder)
        {
            var client = CreateClient();

            return(new SecretsManagerConfigurationProvider(client, Options));
        }
		/// <summary>
		/// Instantiates the facility with the specified configuration builder.
		/// </summary>
		/// <param name="configurationBuilder"></param>
		public NHibernateFacility(IConfigurationBuilder configurationBuilder)
		{
			this.configurationBuilder = configurationBuilder;
		}
Example #58
0
 /// <summary>
 /// Adds the XML configuration provider at <paramref name="path"/> to <paramref name="builder"/>.
 /// </summary>
 /// <param name="builder">The <see cref="IConfigurationBuilder"/> to add to.</param>
 /// <param name="path">Path relative to the base path stored in
 /// <see cref="IConfigurationBuilder.Properties"/> of <paramref name="builder"/>.</param>
 /// <param name="optional">Whether the file is optional.</param>
 /// <returns>The <see cref="IConfigurationBuilder"/>.</returns>
 public static IConfigurationBuilder AddXmlFile(this IConfigurationBuilder builder, string path, bool optional)
 {
     return(AddXmlFile(builder, provider: null, path: path, optional: optional, reloadOnChange: false));
 }
 public IConfigurationProvider Build(IConfigurationBuilder builder)
 {
     return new EntityFrameworkConfigurationProvider(_optionsAction);
 }
Example #60
0
 /// <summary>
 /// Add Json
 /// </summary>
 /// <param name="configurationBuilder">Configuration Builder</param>
 /// <param name="filename">Filename</param>
 /// <param name="settingsJson">Settings JSON</param>
 /// <returns>Configuration Builder</returns>
 public static IConfigurationBuilder AddJson(this IConfigurationBuilder configurationBuilder, string filename, string settingsJson) =>
 configurationBuilder.AddJsonFile(new FileProvider(
                                      new FileInfo(filename, Encoding.UTF8.GetBytes(settingsJson), DateTimeOffset.Now)),
                                  filename, optional: false, reloadOnChange: false);