Skip to content

Instantly share code, notes, and snippets.

@glennc
Last active February 27, 2018 23:01
Show Gist options
  • Save glennc/4700a6013eff85d09bfd3a346370f51e to your computer and use it in GitHub Desktop.
Save glennc/4700a6013eff85d09bfd3a346370f51e to your computer and use it in GitHub Desktop.
MVC compatibility post
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); // Give me the 2.1 behaviors
}
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc()
.SetCompatibilityVersion(CompatibilityVersion.Version_2_1) // Give me all of the 2.1 behaviors
.AddMvcOptions(options =>
{
options.AllowCombineAuthorizationFilters = false; // don't combine authorize filters (keep 2.0 behavior)
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment