Last active
January 20, 2020 12:48
-
-
Save gavilanch/955dffda61629651f757678eca074f6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddScoped<IFileStorageService>((serviceProvider) => | |
{ | |
var env = serviceProvider.GetRequiredService<IWebHostEnvironment>(); | |
var configuration = serviceProvider.GetRequiredService<IConfiguration>(); | |
if (env.IsDevelopment()) | |
{ | |
var httpContextAccessor = serviceProvider.GetRequiredService<IHttpContextAccessor>(); | |
return new InAppStorageService(env, httpContextAccessor); | |
} | |
else | |
{ | |
return new AzureStorageService(configuration); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment