public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) .AddEnvironmentVariables(); Configuration = builder.Build(); // MEF initiliazation this.exportProvider = CompositionContainerFactory.Create(); SettingsInitializer.Initialize <Settings>( this.exportProvider, SettingsDefaultValueProvider <Settings> .Default, AppConfigurationValueProvider.Default); SettingsInitializer.Initialize <DatabaseContextSettings>( this.exportProvider, SettingsDefaultValueProvider <DatabaseContextSettings> .Default, AppConfigurationValueProvider.Default); SettingsInitializer.Initialize <UCenterEventDatabaseContextSettings>( this.exportProvider, SettingsDefaultValueProvider <UCenterEventDatabaseContextSettings> .Default, AppConfigurationValueProvider.Default); CreateDatabaseIndexesAsync().Wait(); }
private static async Task AssemblyInitializeAsync() { ExportProvider = CompositionContainerFactory.Create(); SettingsInitializer.Initialize <Settings>( ExportProvider, SettingsDefaultValueProvider <Settings> .Default, AppConfigurationValueProvider.Default); SettingsInitializer.Initialize <Common.Settings.Settings>( ExportProvider, SettingsDefaultValueProvider <Common.Settings.Settings> .Default, AppConfigurationValueProvider.Default); SettingsInitializer.Initialize <DatabaseContextSettings>( ExportProvider, SettingsDefaultValueProvider <DatabaseContextSettings> .Default, AppConfigurationValueProvider.Default); var settings = ExportProvider.GetExportedValue <Common.Settings.Settings>(); await InitProfileImageBlobsAsync(settings.DefaultProfileImageForFemaleBlobName); await InitProfileImageBlobsAsync(settings.DefaultProfileImageForMaleBlobName); await InitProfileImageBlobsAsync(settings.DefaultProfileThumbnailForFemaleBlobName); await InitProfileImageBlobsAsync(settings.DefaultProfileThumbnailForMaleBlobName); }
private static async Task AssemblyInitializeAsync() { ExportProvider = CompositionContainerFactory.Create(); SettingsInitializer.Initialize <UCenterTestSettings>( ExportProvider, SettingsDefaultValueProvider <UCenterTestSettings> .Default, AppConfigurationValueProvider.Default); SettingsInitializer.Initialize <Settings>( ExportProvider, SettingsDefaultValueProvider <Settings> .Default, AppConfigurationValueProvider.Default); SettingsInitializer.Initialize <DatabaseContextSettings>( ExportProvider, SettingsDefaultValueProvider <DatabaseContextSettings> .Default, AppConfigurationValueProvider.Default); SettingsInitializer.Initialize <UCenterEventDatabaseContextSettings>( ExportProvider, SettingsDefaultValueProvider <UCenterEventDatabaseContextSettings> .Default, AppConfigurationValueProvider.Default); // TODO: This will break distributed unit test! // await InitProfileImageBlobsAsync(settings.DefaultProfileImageForFemaleBlobName); // await InitProfileImageBlobsAsync(settings.DefaultProfileImageForMaleBlobName); // await InitProfileImageBlobsAsync(settings.DefaultProfileThumbnailForFemaleBlobName); // await InitProfileImageBlobsAsync(settings.DefaultProfileThumbnailForMaleBlobName); }
private static void InitializeSettings(ExportProvider exportProvider) { SettingsInitializer.Initialize <Settings>( exportProvider, SettingsDefaultValueProvider <Settings> .Default, AppConfigurationValueProvider.Default); }
public static void AssemblyInitialize(TestContext context) { ExportProvider = CompositionContainerFactory.Create(); SettingsInitializer.Initialize <Settings>(ExportProvider, SettingsDefaultValueProvider <Settings> .Default, AppConfigurationValueProvider.Default); SettingsInitializer.Initialize <Common.Settings.Settings>(ExportProvider, SettingsDefaultValueProvider <Settings> .Default, AppConfigurationValueProvider.Default); }
public ExceptionFilter() { var ExportProvider = CompositionContainerFactory.Create(); SettingsInitializer.Initialize <UCenterEventDatabaseContextSettings>( ExportProvider, SettingsDefaultValueProvider <UCenterEventDatabaseContextSettings> .Default, AppConfigurationValueProvider.Default); this.eventTrace = ExportProvider.GetExportedValue <EventTrace>(); }
/// <summary> /// The application start event /// </summary> protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); ExportProvider exportProvider = CompositionContainerFactory.Create(); ApplicationManager.InitializeApplication(GlobalConfiguration.Configuration, exportProvider); SettingsInitializer.Initialize <Settings>( exportProvider, SettingsDefaultValueProvider <Settings> .Default, AppConfigurationValueProvider.Default); }
/// <summary> /// Function for application start. /// </summary> protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); ExportProvider exportProvider = CompositionContainerFactory.Create(); WebApplicationManager.InitializeApplication(GlobalConfiguration.Configuration, exportProvider); SettingsInitializer.Initialize <Settings>( exportProvider, SettingsDefaultValueProvider <Settings> .Default, AppConfigurationValueProvider.Default); }
public UsersController() { var exportProvider = CompositionContainerFactory.Create(); SettingsInitializer.Initialize <Settings>( exportProvider, SettingsDefaultValueProvider <Settings> .Default, AppConfigurationValueProvider.Default); SettingsInitializer.Initialize <DatabaseContextSettings>( exportProvider, SettingsDefaultValueProvider <DatabaseContextSettings> .Default, AppConfigurationValueProvider.Default); Database = exportProvider.GetExportedValue <DatabaseContext>(); Settings = exportProvider.GetExportedValue <Settings>(); }
public PluginManager(string path) { this.path = path; this.exportProvider = CompositionContainerFactory.Create(); SettingsInitializer.Initialize <DatabaseContextSettings>( this.exportProvider, SettingsDefaultValueProvider <DatabaseContextSettings> .Default, AppConfigurationValueProvider.Default); this.database = exportProvider.GetExportedValue <ManagerDatabaseContext>(); this.plugins = this.GetPlugins(path); this.watcher = new FileSystemWatcher(path, "*" + ManifestFileName); this.watcher.IncludeSubdirectories = true; this.watcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.Size; this.watcher.Changed += Watcher_Changed; this.watcher.Deleted += Watcher_Changed; this.watcher.Created += Watcher_Changed; this.watcher.EnableRaisingEvents = true; }
public ApiControllerBase(DatabaseContext database, Settings settings) { //Database = database; //Settings = settings; var exportProvider = CompositionContainerFactory.Create(); SettingsInitializer.Initialize <Settings>( exportProvider, SettingsDefaultValueProvider <Settings> .Default, AppConfigurationValueProvider.Default); SettingsInitializer.Initialize <DatabaseContextSettings>( exportProvider, SettingsDefaultValueProvider <DatabaseContextSettings> .Default, AppConfigurationValueProvider.Default); Database = exportProvider.GetExportedValue <DatabaseContext>(); Settings = exportProvider.GetExportedValue <Settings>(); }