Skip to content

Instantly share code, notes, and snippets.

@aranm
Last active August 6, 2019 06:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aranm/067a7245b02db4148a086408d83b9948 to your computer and use it in GitHub Desktop.
Save aranm/067a7245b02db4148a086408d83b9948 to your computer and use it in GitHub Desktop.
[assembly: FunctionsStartup(typeof(Startup))]
namespace MyFunctionsProject
{
public class Startup : FunctionsStartup
{
public override void Configure(IFunctionsHostBuilder builder)
{
// this will bind to the "Values" section of the configuration
builder
.Services
.AddOptions<ApplicationSettings>()
.Configure<IConfiguration>((settings, configuration) => { configuration.Bind(settings); });
// this will bind to a specific section of the configuration
// by using the section name, in this case "ConnectionStrings"
builder
.Services
.AddOptions<ConnectionStrings>()
.Configure<IConfiguration>((settings, configuration) => { configuration.Bind("ConnectionStrings", settings); });
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment