Keeping a Clean Startup.cs in Asp.Net Core

added by DotNetKicks
8/30/2016 1:19:17 PM

850 Views

public static class ServiceCollectionExtensions { public static IServiceCollection AddCustomizedMvc(this IServiceCollection services) { var locationFormat = @"Features\Shared\{0}.cshtml"; var expander = new ViewWithControllerViewLocationExpander(); services.AddMvc() .AddRazorOptions(options => { options.ViewLocationFormats.Clear(); options.ViewLocationFormats.Add(locationFormat); options.ViewLocationExpanders.Add(expander); }); return services; } // ... }


0 comments