30
30
using puckweb . Data . Contexts ;
31
31
using puckweb . Data . Entities ;
32
32
using Microsoft . AspNetCore . Authentication . Cookies ;
33
+ using SixLabors . ImageSharp . Web . Providers . Azure ;
33
34
34
35
namespace puckweb
35
36
{
@@ -69,7 +70,7 @@ public void ConfigureServices(IServiceCollection services)
69
70
70
71
PhysicalFileSystemProvider PhysicalProviderFactory ( IServiceProvider provider )
71
72
{
72
- var env = provider . GetRequiredService < Microsoft . AspNetCore . Hosting . IHostingEnvironment > ( ) ;
73
+ var env = provider . GetRequiredService < Microsoft . AspNetCore . Hosting . IWebHostEnvironment > ( ) ;
73
74
env . WebRootFileProvider = new PhysicalFileProvider ( env . WebRootPath ) ;
74
75
var p = new PhysicalFileSystemProvider (
75
76
env ,
@@ -108,16 +109,19 @@ AzureBlobStorageImageProvider AzureProviderFactory(IServiceProvider provider)
108
109
{
109
110
return new PhysicalFileSystemCache (
110
111
provider . GetRequiredService < IOptions < PhysicalFileSystemCacheOptions > > ( ) ,
111
- provider . GetRequiredService < Microsoft . AspNetCore . Hosting . IHostingEnvironment > ( ) ,
112
+ provider . GetRequiredService < Microsoft . AspNetCore . Hosting . IWebHostEnvironment > ( ) ,
112
113
provider . GetRequiredService < IOptions < ImageSharpMiddlewareOptions > > ( ) ,
113
114
provider . GetRequiredService < FormatUtilities > ( ) ) ;
114
115
} )
115
116
. SetCacheHash < CacheHash > ( )
116
117
. AddProvider ( AzureProviderFactory )
117
118
. Configure < AzureBlobStorageImageProviderOptions > ( options =>
118
119
{
119
- options . ConnectionString = Configuration . GetValue < string > ( "AzureBlobStorageConnectionString" ) ;
120
- options . ContainerName = Configuration . GetValue < string > ( "AzureImageTransformer_ContainerName" ) ;
120
+ options . BlobContainers . Add ( new AzureBlobContainerClientOptions
121
+ {
122
+ ConnectionString = Configuration . GetValue < string > ( "AzureBlobStorageConnectionString" ) ,
123
+ ContainerName = Configuration . GetValue < string > ( "AzureImageTransformer_ContainerName" )
124
+ } ) ;
121
125
} )
122
126
. AddProvider ( PhysicalProviderFactory )
123
127
. AddProcessor < CropWebProcessor > ( )
@@ -132,7 +136,7 @@ AzureBlobStorageImageProvider AzureProviderFactory(IServiceProvider provider)
132
136
{
133
137
return new PhysicalFileSystemCache (
134
138
provider . GetRequiredService < IOptions < PhysicalFileSystemCacheOptions > > ( ) ,
135
- provider . GetRequiredService < Microsoft . AspNetCore . Hosting . IHostingEnvironment > ( ) ,
139
+ provider . GetRequiredService < Microsoft . AspNetCore . Hosting . IWebHostEnvironment > ( ) ,
136
140
provider . GetRequiredService < IOptions < ImageSharpMiddlewareOptions > > ( ) ,
137
141
provider . GetRequiredService < FormatUtilities > ( ) ) ;
138
142
} )
0 commit comments