public static ConfigurationRootModel BuildContainer( ContainerBuilder containerBuilder, IServiceFabricConfigurationService serviceFabricConfigurationService) { IStatelessServiceConfiguration statelessServiceConfiguration = serviceFabricConfigurationService.GetConfigSectionAsStatelessServiceConfiguration(); containerBuilder.RegisterModule(new StatelessServiceModule(statelessServiceConfiguration)); ReportServiceConfiguration reportServiceConfiguration = serviceFabricConfigurationService.GetConfigSectionAs <ReportServiceConfiguration>("ReportServiceConfiguration"); AzureStorageOptions azureBlobStorageOptions = serviceFabricConfigurationService.GetConfigSectionAs <AzureStorageOptions>("AzureStorageSection"); VersionInfo versionInfo = serviceFabricConfigurationService.GetConfigSectionAs <VersionInfo>("VersionSection"); // register message mapper containerBuilder.RegisterType <DefaultJobContextMessageMapper <JobContextMessage> >().As <IMapper <JobContextMessage, JobContextMessage> >(); // register MessageHandler containerBuilder.RegisterType <MessageHandler>().As <IMessageHandler <JobContextMessage> >().InstancePerLifetimeScope(); containerBuilder.RegisterType <JobContextManager <JobContextMessage> >().As <IJobContextManager <JobContextMessage> >() .InstancePerLifetimeScope(); containerBuilder.RegisterType <JobContextMessage>().As <IJobContextMessage>() .InstancePerLifetimeScope(); containerBuilder.RegisterModule <SerializationModule>(); return(new ConfigurationRootModel { reportServiceConfiguration = reportServiceConfiguration, azureBlobStorageOptions = azureBlobStorageOptions, versionInfo = versionInfo }); }
public PostCache( IOptionsMonitor <AzureStorageOptions> optionsMonitor, CloudTableClient cloudTableClient) { this._posts = new List <Post>(); this._options = optionsMonitor?.CurrentValue ?? throw new ArgumentNullException(nameof(optionsMonitor)); this._cloudTableClient = cloudTableClient ?? throw new ArgumentNullException(nameof(cloudTableClient)); this._timeStamp = this.RefreshCache(); }
public static void BuildStorageFileSystem( ContainerBuilder containerBuilder, AzureStorageOptions azureBlobStorageOptions, IStreamableKeyValuePersistenceService storagePersistenceService) { containerBuilder.RegisterInstance(azureBlobStorageOptions).As <IAzureStorageOptions>(); containerBuilder.RegisterType <FileSystemFileService>().As <IFileService>(); containerBuilder.RegisterInstance(storagePersistenceService) .As <IStreamableKeyValuePersistenceService>() .SingleInstance(); }
public AzureStorageBlogService( IPostCache postCache, IWebHostEnvironment env, IHttpContextAccessor contextAccessor, IOptionsMonitor <AzureStorageOptions> optionsMonitor, CloudTableClient cloudTableClient) : base(postCache, env, contextAccessor) { this._options = optionsMonitor?.CurrentValue ?? throw new ArgumentNullException(nameof(optionsMonitor)); this._cloudTableClient = cloudTableClient ?? throw new ArgumentNullException(nameof(cloudTableClient)); }
public static void AddAzureStorageContext(this IServiceCollection services, Action <AzureStorageOptions> setupAction) { if (setupAction == null) { throw new ArgumentNullException(nameof(setupAction)); } services.AddSingleton <AzureStorageContext>((serviceProvider) => { AzureStorageOptions options = new AzureStorageOptions(); setupAction(options); return(new DefaultAzureStorageContext(options.ConnectionString)); }); }
public static void AddAzureStorageContext <TAzureStorageContext>(this IServiceCollection services, Action <AzureStorageOptions> setupAction) where TAzureStorageContext : AzureStorageContext { if (setupAction == null) { throw new ArgumentNullException(nameof(setupAction)); } services.AddSingleton <TAzureStorageContext>((serviceProvider) => { AzureStorageOptions options = new AzureStorageOptions(); setupAction(options); return((TAzureStorageContext)Activator.CreateInstance(typeof(TAzureStorageContext), new object[] { options.ConnectionString })); }); }
public static void BuildStorageContainerAzure( ContainerBuilder containerBuilder, AzureStorageOptions azureBlobStorageOptions) { // register azure blob storage service containerBuilder.RegisterInstance(azureBlobStorageOptions).As <IAzureStorageOptions>(); containerBuilder.Register(c => new AzureStorageKeyValuePersistenceConfig( azureBlobStorageOptions.AzureBlobConnectionString, azureBlobStorageOptions.AzureBlobContainerName)) .As <IAzureStorageKeyValuePersistenceServiceConfig>().SingleInstance(); containerBuilder.RegisterType <AzureStorageKeyValuePersistenceService>() .As <IStreamableKeyValuePersistenceService>() .InstancePerLifetimeScope(); AzureStorageFileServiceConfiguration azureStorageFileServiceConfiguration = new AzureStorageFileServiceConfiguration() { ConnectionString = azureBlobStorageOptions.AzureBlobConnectionString, }; containerBuilder.RegisterInstance(azureStorageFileServiceConfiguration).As <IAzureStorageFileServiceConfiguration>(); containerBuilder.RegisterType <AzureStorageFileService>().As <IFileService>(); }
public StorageService(IOptions <AzureStorageOptions> options) { _options = options.Value; }
public UploadService(AzureStorageOptions storageOptions) { this.StorageOptions = storageOptions; }
public AzureStorageScheduleConnectorService(AzureStorageOptions options) { _options = options ?? throw new ArgumentNullException(nameof(options)); }
public QueueService(AzureStorageOptions storageOptions) { this.StorageOptions = storageOptions; }
public ApplicationTeamMembersStorageProvider(AzureStorageOptions azureStorageOptions) : base(azureStorageOptions, "application-team-members") { }
public QueuePusher(IOptions <AzureStorageOptions> azureStorageOptions, JsonSerializer jsonSerializer) { _jsonSerializer = jsonSerializer; _azureStorageOptions = azureStorageOptions.Value; }
public ImagesController(IOptionsSnapshot <AzureStorageOptions> azureStorageOptions, IOptionsSnapshot <AzureAdOptions> azureAdOptions) { _azureAdOptions = azureAdOptions.Value; _azureStorageOptions = azureStorageOptions.Value; }
public AzureBlobStorageService(AzureStorageOptions options) { _options = options; _blobServiceClient = new BlobServiceClient(options.StorageConnectionString); }
public ExpertApplicationsStorageProvider(AzureStorageOptions azureStorageOptions) : base(azureStorageOptions, "expert-applications") { }
public TeamCloudAdapterAuthorizeOptions(AzureStorageOptions azureStorageOptions) { this.azureStorageOptions = azureStorageOptions ?? throw new ArgumentNullException(nameof(azureStorageOptions)); }
public ProjectStorageProvider(AzureStorageOptions azureStorageOptions) : base(azureStorageOptions, "projects") { }
public OneTimeTokenServiceOptions(AzureStorageOptions azureStorageOptions) { this.azureStorageOptions = azureStorageOptions ?? throw new ArgumentNullException(nameof(azureStorageOptions)); }
public AuthorizationTokenOptions(AzureStorageOptions azureStorageOptions) { this.azureStorageOptions = azureStorageOptions ?? throw new ArgumentNullException(nameof(azureStorageOptions)); }
public QueueService(IOptions <AzureStorageOptions> storageOptions) { this.StorageOptions = storageOptions?.Value; }
public ProjectTeamMembersStorageProvider(AzureStorageOptions azureStorageOptions) : base(azureStorageOptions, "project-team-members") { }
public AzureStorageAppService(AzureStorageOptions options) { _options = options ?? throw new ArgumentNullException(nameof(options)); }
public AzureStorageScheduleCacheService(AzureStorageOptions options, ILogger <AzureStorageBlobService> log) : base(options, log) { }
private static IServiceCollection AddAzureStorageService(this IServiceCollection services, AzureStorageOptions options) { services.AddSingleton(_ => { var storageCredentials = new StorageCredentials( accountName: options.AccountName, keyValue: options.AccountKey1 ?? options.AccountKey2); var storageAccount = new CloudStorageAccount( storageCredentials: storageCredentials, useHttps: true); return(storageAccount.CreateCloudBlobClient()); }); services.AddSingleton <IStorageService, AzureStorageService>(); return(services); }
public UploadService(IOptions <AzureStorageOptions> storageOptions) { this.StorageOptions = storageOptions?.Value; }
/// <summary> /// Initializes a new instance of the <see cref="AzureFileShareStorageManager" /> class. /// </summary> /// <param name="options">The options.</param> public AzureFileShareStorageManager(AzureStorageOptions options) { this._shareClient = new ShareClient(options.ConnectionString, options.Name); }
public AzureStorageBlobService(AzureStorageOptions options, ILogger <AzureStorageBlobService> log) { _options = options ?? throw new ArgumentNullException(nameof(options)); _log = log ?? throw new ArgumentNullException(nameof(log)); }