Skip to content

Instantly share code, notes, and snippets.

@bruceharrison1984
Created September 5, 2019 04:20
Show Gist options
  • Save bruceharrison1984/00f1fddc6adff237d6d99eda9d863524 to your computer and use it in GitHub Desktop.
Save bruceharrison1984/00f1fddc6adff237d6d99eda9d863524 to your computer and use it in GitHub Desktop.
public override void Configure(IFunctionsHostBuilder builder)
{
...
builder.Services.AddLogging();
//workaround azure functions not handling nested arrays by default
builder.Services.AddTransient<IConfigureOptions<MvcOptions>, MvcJsonMvcOptionsSetup>();
builder.Services.AddTransient<BaseValidator<Widget>, WidgetValidator>(o => new WidgetValidator());
builder.Services.AddTransient<BaseValidator<User>, UserValidator>(o => new UserValidator());
builder.Services.AddTransient<FunctionWrapper<Widget>>();
builder.Services.AddTransient<FunctionWrapper<User>>();
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment