Skip to content

Instantly share code, notes, and snippets.

@dmitry-zaets
Created May 17, 2017 11:28
Show Gist options
  • Save dmitry-zaets/9fd6c5b07ef5e33dbb9882e0c6d73669 to your computer and use it in GitHub Desktop.
Save dmitry-zaets/9fd6c5b07ef5e33dbb9882e0c6d73669 to your computer and use it in GitHub Desktop.
var configurationBuilder = new ConfigurationBuilder()
.SetBasePath(Path.Combine(HttpRuntime.AppDomainAppPath, "configs"))
.AddJsonFile("settings.json", optional: false);
var configuration = configurationBuilder.Build();
var builder = new ContainerBuilder();
builder.RegisterOptions();
builder.RegisterConfigurationOptions<MailingOptions>(configuration.GetSection("mailing"));
builder.RegisterConfigurationOptions<FeedOptions>(configuration.GetSection("feed"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment