Removing 'Options' from ConfigureMvcOptions and ConfigureRazorViewEngineOptions.

This commit is contained in:
sornaks 2015-03-16 14:31:49 -07:00
parent c1338a0542
commit d2bdd4f1d4
7 changed files with 11 additions and 11 deletions

View File

@ -58,13 +58,13 @@ namespace MvcSample.Web
services.AddSingleton<UserNameService>();
services.AddTransient<ITestService, TestService>();
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<UserNameService>();
services.AddTransient<ITestService, TestService>();
services.ConfigureMvcOptions(options =>
services.ConfigureMvc(options =>
{
options.Filters.Add(typeof(PassThroughAttribute), order: 17);
options.AddXmlDataContractSerializerFormatter();

View File

@ -19,7 +19,7 @@ namespace Microsoft.Framework.DependencyInjection
/// </summary>
/// <param name="services">The services available in the application.</param>
/// <param name="setupAction">An action to configure the <see cref="RazorViewEngineOptions"/>.</param>
public static void ConfigureRazorViewEngineOptions(
public static void ConfigureRazorViewEngine(
[NotNull] this IServiceCollection services,
[NotNull] Action<RazorViewEngineOptions> setupAction)
{

View File

@ -17,13 +17,13 @@ namespace Microsoft.AspNet.Mvc
/// </summary>
public class MvcOptionsSetup : ConfigureOptions<MvcOptions>
{
public MvcOptionsSetup() : base(ConfigureMvcOptions)
public MvcOptionsSetup() : base(ConfigureMvc)
{
Order = DefaultOrder.DefaultFrameworkSortOrder;
}
/// <inheritdoc />
public static void ConfigureMvcOptions(MvcOptions options)
public static void ConfigureMvc(MvcOptions options)
{
// Set up ViewEngines
options.ViewEngines.Add(typeof(RazorViewEngine));

View File

@ -26,7 +26,7 @@ namespace Microsoft.Framework.DependencyInjection
/// </summary>
/// <param name="services">The services available in the application.</param>
/// <param name="setupAction">The <see cref="MvcOptions"/> which need to be configured.</param>
public static void ConfigureMvcOptions(
public static void ConfigureMvc(
[NotNull] this IServiceCollection services,
[NotNull] Action<MvcOptions> setupAction)
{

View File

@ -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);

View File

@ -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;
});

View File

@ -22,7 +22,7 @@ namespace BasicWebSite
services.AddSingleton<IActionDescriptorProvider, ActionDescriptorCreationCounter>();
services.ConfigureMvcOptions(options =>
services.ConfigureMvc(options =>
{
options.Conventions.Add(new ApplicationDescription("This is a basic website."));
});