[Fixes #2156] Remove IConfiguration from AddMvc
This commit is contained in:
parent
9a44e3e08b
commit
f06007d428
|
|
@ -7,7 +7,6 @@ using System.Linq;
|
|||
using System.Reflection;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNet.Routing;
|
||||
using Microsoft.Framework.ConfigurationModel;
|
||||
using Microsoft.Framework.Internal;
|
||||
using Microsoft.Framework.Logging;
|
||||
|
||||
|
|
@ -15,11 +14,6 @@ namespace Microsoft.Framework.DependencyInjection
|
|||
{
|
||||
public static class MvcServiceCollectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddMvc([NotNull] this IServiceCollection services, IConfiguration config)
|
||||
{
|
||||
return services.AddMvc();
|
||||
}
|
||||
|
||||
public static IServiceCollection AddMvc([NotNull] this IServiceCollection services)
|
||||
{
|
||||
ConfigureDefaultServices(services);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace ActionConstraintsWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
services.Configure<MvcOptions>(options =>
|
||||
{
|
||||
options.AddXmlDataContractSerializerFormatter();
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace ActionResultsWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
|
||||
services.Configure<MvcOptions>(options =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace ActivatorWebSite
|
|||
app.UseServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
services.AddInstance(new MyService());
|
||||
services.AddScoped<ViewService, ViewService>();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace AntiForgeryWebSite
|
|||
var configuration = app.GetTestConfiguration();
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
});
|
||||
|
||||
app.UseErrorReporter();
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace ApiExplorerWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
services.AddSingleton<ApiExplorerDataFilter>();
|
||||
|
||||
services.Configure<MvcOptions>(options =>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace ApplicationModelWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
|
||||
services.Configure<MvcOptions>(options =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace AutofacWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
services.AddTransient<HelloWorldBuilder>();
|
||||
|
||||
var builder = new ContainerBuilder();
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace BasicWebSite
|
|||
app.UseServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
|
||||
services.AddSingleton<IActionDescriptorProvider, ActionDescriptorCreationCounter>();
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace BestEffortLinkGenerationWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
services.Configure<RouteOptions>((options) =>
|
||||
{
|
||||
options.UseBestEffortLinkGeneration = true;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace CompositeViewEngineWebSite
|
|||
app.UseServices(services =>
|
||||
{
|
||||
// Add a view engine as the first one in the list.
|
||||
services.AddMvc(configuration)
|
||||
services.AddMvc()
|
||||
.Configure<MvcOptions>(options =>
|
||||
{
|
||||
options.ViewEngines.Insert(0, typeof(TestViewEngine));
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace ContentNegotiationWebSite
|
|||
app.UseServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
|
||||
services.Configure<MvcOptions>(options =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace ControllerDiscoveryConventionsWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
});
|
||||
|
||||
app.UseMvc(routes =>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace ControllersFromServicesWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration)
|
||||
services.AddMvc()
|
||||
.WithControllersAsServices(
|
||||
new[]
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace CustomRouteWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
});
|
||||
|
||||
app.UseMvc(routes =>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace ErrorPageMiddlewareWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
});
|
||||
|
||||
app.UseErrorPage();
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace FilesWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
});
|
||||
|
||||
app.UseMiddleware<SendFileMiddleware>();
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace FiltersWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
services.ConfigureAuthorization(options =>
|
||||
{
|
||||
// This policy cannot succeed since it has no requirements
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace FormatFilterWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
services.Configure<MvcOptions>(options =>
|
||||
{
|
||||
var formatFilter = new FormatFilterAttribute();
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace FormatterWebSite
|
|||
app.UseServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
|
||||
services.Configure<MvcOptions>(options =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace InlineConstraints
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
});
|
||||
|
||||
app.UseErrorReporter();
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace LoggingWebSite
|
|||
options.Filter = (loggerName, logLevel) => true;
|
||||
});
|
||||
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
});
|
||||
|
||||
app.Map("/logs", (appBuilder) =>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace LowercaseUrlsWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
|
||||
services.Configure<RouteOptions>(routeOptions => routeOptions.LowercaseUrls = true);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace ModelBindingWebSite
|
|||
app.UseServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration)
|
||||
services.AddMvc()
|
||||
.Configure<MvcOptions>(m =>
|
||||
{
|
||||
m.MaxModelValidationErrors = 8;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace MvcTagHelpersWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
services.AddSingleton<ProductsService>();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace PrecompilationWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
});
|
||||
|
||||
app.UseMvc(routes =>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace RazorCompilerCacheWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
services.AddSingleton<ICompilerCache, CustomCompilerCache>();
|
||||
services.AddSingleton<CompilerCacheInitialiedService>();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace RazorEmbeddedViewsWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
|
||||
services.Configure<RazorViewEngineOptions>(options =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace RazorPageExecutionInstrumentationWebSite
|
|||
app.UseServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
});
|
||||
|
||||
app.Use(async (HttpContext context, Func<Task> next) =>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace RazorWebSite
|
|||
app.UseServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
services.AddTransient<InjectedHelper>();
|
||||
services.AddTransient<TaskReturningService>();
|
||||
services.AddTransient<FrameworkSpecificHelper>();
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace RequestServicesWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
|
||||
services.AddScoped<RequestIdService>();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace ResponseCacheWebSite
|
|||
var configuration = app.GetTestConfiguration();
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
services.Configure<MvcOptions>(options =>
|
||||
{
|
||||
options.CacheProfiles.Add(
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace RoutingWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
|
||||
services.AddScoped<TestResponseGenerator>();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace TagHelpersWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
});
|
||||
|
||||
app.UseMvc(routes =>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace TempDataWebSite
|
|||
{
|
||||
services.AddCaching();
|
||||
services.AddSession();
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
});
|
||||
|
||||
app.UseInMemorySession();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace UrlHelperWebSite
|
|||
});
|
||||
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
|
||||
services.AddScoped<IUrlHelper, CustomUrlHelper>();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace ValidationWebSite
|
|||
app.UseServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
});
|
||||
|
||||
app.UseErrorReporter();
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace ValueProvidersWebSite
|
|||
app.UseServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration)
|
||||
services.AddMvc()
|
||||
.Configure<MvcOptions>(options =>
|
||||
{
|
||||
options.ValueProviderFactories.Insert(1, new CustomValueProviderFactory());
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace VersioningWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
|
||||
services.AddScoped<TestResponseGenerator>();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace ViewComponentWebSite
|
|||
var configuration = app.GetTestConfiguration();
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
});
|
||||
|
||||
app.UseMvc(routes =>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace WebApiCompatShimWebSite
|
|||
|
||||
app.UseServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
services.AddWebApiConventions();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace XmlFormattersWebSite
|
|||
app.UseServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
services.AddMvc();
|
||||
|
||||
services.Configure<MvcOptions>(options =>
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue