From d2bdd4f1d4096e2387ff2435ef0c0eed1dcb2c53 Mon Sep 17 00:00:00 2001 From: sornaks Date: Mon, 16 Mar 2015 14:31:49 -0700 Subject: [PATCH] Removing 'Options' from ConfigureMvcOptions and ConfigureRazorViewEngineOptions. --- samples/MvcSample.Web/Startup.cs | 6 +++--- .../RazorServiceCollectionExtensions.cs | 2 +- src/Microsoft.AspNet.Mvc/MvcOptionsSetup.cs | 4 ++-- src/Microsoft.AspNet.Mvc/MvcServiceCollectionExtensions.cs | 2 +- test/Microsoft.AspNet.Mvc.FunctionalTests/BasicTests.cs | 2 +- .../RazorViewEngineOptionsTest.cs | 4 ++-- test/WebSites/BasicWebSite/Startup.cs | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/samples/MvcSample.Web/Startup.cs b/samples/MvcSample.Web/Startup.cs index 66e7acbfef..e0ea73ae53 100644 --- a/samples/MvcSample.Web/Startup.cs +++ b/samples/MvcSample.Web/Startup.cs @@ -58,13 +58,13 @@ namespace MvcSample.Web services.AddSingleton(); services.AddTransient(); - services.ConfigureMvcOptions(options => + services.ConfigureMvc(options => { options.Filters.Add(typeof(PassThroughAttribute), order: 17); options.AddXmlDataContractSerializerFormatter(); options.Filters.Add(new FormatFilterAttribute()); }); - services.ConfigureRazorViewEngineOptions(options => + services.ConfigureRazorViewEngine(options => { var expander = new LanguageViewLocationExpander( context => context.HttpContext.Request.Query["language"]); @@ -99,7 +99,7 @@ namespace MvcSample.Web services.AddSingleton(); services.AddTransient(); - services.ConfigureMvcOptions(options => + services.ConfigureMvc(options => { options.Filters.Add(typeof(PassThroughAttribute), order: 17); options.AddXmlDataContractSerializerFormatter(); diff --git a/src/Microsoft.AspNet.Mvc.Razor/RazorServiceCollectionExtensions.cs b/src/Microsoft.AspNet.Mvc.Razor/RazorServiceCollectionExtensions.cs index d0318a4a8f..6e04b8d379 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/RazorServiceCollectionExtensions.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/RazorServiceCollectionExtensions.cs @@ -19,7 +19,7 @@ namespace Microsoft.Framework.DependencyInjection /// /// The services available in the application. /// An action to configure the . - public static void ConfigureRazorViewEngineOptions( + public static void ConfigureRazorViewEngine( [NotNull] this IServiceCollection services, [NotNull] Action setupAction) { diff --git a/src/Microsoft.AspNet.Mvc/MvcOptionsSetup.cs b/src/Microsoft.AspNet.Mvc/MvcOptionsSetup.cs index 7b0f2e183d..2b642ea8cd 100644 --- a/src/Microsoft.AspNet.Mvc/MvcOptionsSetup.cs +++ b/src/Microsoft.AspNet.Mvc/MvcOptionsSetup.cs @@ -17,13 +17,13 @@ namespace Microsoft.AspNet.Mvc /// public class MvcOptionsSetup : ConfigureOptions { - public MvcOptionsSetup() : base(ConfigureMvcOptions) + public MvcOptionsSetup() : base(ConfigureMvc) { Order = DefaultOrder.DefaultFrameworkSortOrder; } /// - public static void ConfigureMvcOptions(MvcOptions options) + public static void ConfigureMvc(MvcOptions options) { // Set up ViewEngines options.ViewEngines.Add(typeof(RazorViewEngine)); diff --git a/src/Microsoft.AspNet.Mvc/MvcServiceCollectionExtensions.cs b/src/Microsoft.AspNet.Mvc/MvcServiceCollectionExtensions.cs index dc9ef637ce..289b22af0c 100644 --- a/src/Microsoft.AspNet.Mvc/MvcServiceCollectionExtensions.cs +++ b/src/Microsoft.AspNet.Mvc/MvcServiceCollectionExtensions.cs @@ -26,7 +26,7 @@ namespace Microsoft.Framework.DependencyInjection /// /// The services available in the application. /// The which need to be configured. - public static void ConfigureMvcOptions( + public static void ConfigureMvc( [NotNull] this IServiceCollection services, [NotNull] Action setupAction) { diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/BasicTests.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/BasicTests.cs index f411f2d134..54c20dbd47 100644 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/BasicTests.cs +++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/BasicTests.cs @@ -260,7 +260,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests } [Fact] - public async Task ConfigureMvcOptionsAddsOptionsProperly() + public async Task ConfigureMvc_AddsOptionsProperly() { // Arrange var server = TestHelper.CreateServer(_app, SiteName); diff --git a/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewEngineOptionsTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewEngineOptionsTest.cs index 4224746d60..4665e4220a 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewEngineOptionsTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewEngineOptionsTest.cs @@ -22,14 +22,14 @@ namespace Microsoft.AspNet.Mvc.Razor } [Fact] - public void ConfigureRazorViewEngineOptions_ConfiguresOptionsProperly() + public void ConfigureRazorViewEngine_ConfiguresOptionsProperly() { // Arrange var services = new ServiceCollection().AddOptions(); var fileProvider = new TestFileProvider(); // Act - services.ConfigureRazorViewEngineOptions(options => + services.ConfigureRazorViewEngine(options => { options.FileProvider = fileProvider; }); diff --git a/test/WebSites/BasicWebSite/Startup.cs b/test/WebSites/BasicWebSite/Startup.cs index c08b5e5580..bd57528e46 100644 --- a/test/WebSites/BasicWebSite/Startup.cs +++ b/test/WebSites/BasicWebSite/Startup.cs @@ -22,7 +22,7 @@ namespace BasicWebSite services.AddSingleton(); - services.ConfigureMvcOptions(options => + services.ConfigureMvc(options => { options.Conventions.Add(new ApplicationDescription("This is a basic website.")); });