Created
February 3, 2020 07:55
-
-
Save kasunkv/9bc1767f9e79f2e3fee043ea2409f0b5 to your computer and use it in GitHub Desktop.
Using LocalFileOfflineCache implementation
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
public static IHostBuilder CreateHostBuilder(string[] args) => | |
Host.CreateDefaultBuilder(args) | |
.ConfigureWebHostDefaults(webBuilder => { | |
webBuilder.UseStartup<Startup>(); | |
}) | |
.ConfigureAppConfiguration((context, config) => { | |
var settings = config.Build(); | |
var appConfigEndpoint = settings["AppSettings:AppConfiguration:Endpoint"]; | |
if (!string.IsNullOrEmpty(appConfigEndpoint)) | |
{ | |
var endpoint = new Uri(appConfigEndpoint); | |
config.AddAzureAppConfiguration(options => | |
{ | |
... | |
options | |
// Use the custom IOfflineCache implementation | |
.SetOfflineCache(new LocalFileOfflineCache(context.HostingEnvironment)); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment