Created
October 20, 2017 18:16
-
-
Save talkingdotnet/85d56618975a9c434799571ecf149790 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/// <summary> | |
/// Configures Razor Pages to be rooted at the content root (<see cref="IHostingEnvironment.ContentRootPath"/>). | |
/// </summary> | |
/// <param name="builder">The <see cref="IMvcCoreBuilder"/>.</param> | |
/// <returns>The <see cref="IMvcBuilder"/>.</returns> | |
public static IMvcBuilder WithRazorPagesAtContentRoot(this IMvcBuilder builder) | |
{ | |
if (builder == null) | |
{ | |
throw new ArgumentNullException(nameof(builder)); | |
} | |
builder.Services.Configure<RazorPagesOptions>(options => options.RootDirectory = "/"); | |
return builder; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment