コード例 #1
0
        private static IServiceCollection AddServices(IServiceCollection services, SharedConfigSettings sharedConfigSettings)
        {
            services.AddSingleton(sharedConfigSettings);
            services.AddSingleton <ISharedConfigCacheProvider>(s => new InMemorySharedConfigCacheProvider(sharedConfigSettings));
            services.AddSingleton <ITableOperationService, TableOperationService>();
            services.AddSingleton <ISharedConfigurationService, SharedConfigurationService>();

            return(services);
        }
コード例 #2
0
        public InMemorySharedConfigCacheProviderTests()
        {
            var defaultCacheValues = GetDefaultCacheValues();

            settings = new SharedConfigSettings
            {
                ConfigurationStorageConnectionString = "DummyConnectionString",
                InMemoryCacheTimeToLiveTimeSpan      = "00:01:00",
                CloudStorageTableName = "CloudTableName",
                EnvironmentName       = "Develop"
            };

            configCacheProvider = new InMemorySharedConfigCacheProvider(settings, defaultCacheValues);
        }
コード例 #3
0
 public static IServiceCollection AddFileStorageSharedConfigService(this IServiceCollection services, SharedConfigSettings sharedConfigSettings)
 {
     services.AddSingleton <IConfigurationRepository, FileStorageConfigurationRepository>();
     return(AddServices(services, sharedConfigSettings));
 }
 public AzureTableStorageConfigurationRepository(SharedConfigSettings settings, ITableOperationService tableOperationService)
 {
     this.settings = settings;
     this.tableOperationService = tableOperationService;
 }
 public InMemorySharedConfigCacheProvider(SharedConfigSettings settings, ConcurrentDictionary <string, object> cacheValues)
 {
     this.settings = settings;
     this.cache    = cacheValues;
 }
 public InMemorySharedConfigCacheProvider(SharedConfigSettings settings)
 {
     this.settings = settings;
     this.cache    = new ConcurrentDictionary <string, object>();
 }