protected override void ConfigureCustomServices(IServiceCollection services, IImageSharpBuilder builder)
        => builder
        .Configure <AzureBlobStorageImageProviderOptions>(o =>
                                                          o.BlobContainers.Add(
                                                              new AzureBlobContainerClientOptions
        {
            ConnectionString = TestConstants.AzureConnectionString,
            ContainerName    = TestConstants.AzureContainerName
        }))
        .AddProvider(AzureBlobStorageImageProviderFactory.Create)
        .Configure <AzureBlobStorageCacheOptions>(o =>
        {
            o.ConnectionString = TestConstants.AzureConnectionString;
            o.ContainerName    = TestConstants.AzureCacheContainerName;

            AzureBlobStorageCache.CreateIfNotExists(o, PublicAccessType.None);
        })
        .SetCache <AzureBlobStorageCache>();
Esempio n. 2
0
        protected override void ConfigureCustomServices(IServiceCollection services, IImageSharpBuilder builder)
        => builder
        .Configure <AWSS3StorageImageProviderOptions>(o =>
                                                      o.S3Buckets.Add(
                                                          new AWSS3BucketClientOptions
        {
            Endpoint     = TestConstants.AWSEndpoint,
            BucketName   = TestConstants.AWSBucketName,
            AccessKey    = TestConstants.AWSAccessKey,
            AccessSecret = TestConstants.AWSAccessSecret,
            Region       = TestConstants.AWSRegion
        }))
        .AddProvider(AWSS3StorageImageProviderFactory.Create)
        .Configure <AWSS3StorageCacheOptions>(o =>
        {
            o.Endpoint     = TestConstants.AWSEndpoint;
            o.BucketName   = TestConstants.AWSCacheBucketName;
            o.AccessKey    = TestConstants.AWSAccessKey;
            o.AccessSecret = TestConstants.AWSAccessSecret;
            o.Region       = TestConstants.AWSRegion;

            AWSS3StorageCache.CreateIfNotExists(o, S3CannedACL.Private);
        })
        .SetCache <AWSS3StorageCache>();