Remove AddDispatcher/UseDispatcher
This commit is contained in:
parent
52e5852e48
commit
2c325440de
|
|
@ -12,12 +12,6 @@ namespace Microsoft.AspNetCore.Builder
|
||||||
{
|
{
|
||||||
private const string GlobalRoutingRegisteredKey = "__GlobalRoutingMiddlewareRegistered";
|
private const string GlobalRoutingRegisteredKey = "__GlobalRoutingMiddlewareRegistered";
|
||||||
|
|
||||||
// This is provided temporarily until we can remove usages of it from MVC.
|
|
||||||
public static IApplicationBuilder UseDispatcher(this IApplicationBuilder builder)
|
|
||||||
{
|
|
||||||
return UseGlobalRouting(builder);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IApplicationBuilder UseGlobalRouting(this IApplicationBuilder builder)
|
public static IApplicationBuilder UseGlobalRouting(this IApplicationBuilder builder)
|
||||||
{
|
{
|
||||||
VerifyRoutingIsRegistered(builder);
|
VerifyRoutingIsRegistered(builder);
|
||||||
|
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using Microsoft.AspNetCore.Routing;
|
|
||||||
|
|
||||||
namespace Microsoft.Extensions.DependencyInjection
|
|
||||||
{
|
|
||||||
// This whole class is temporary until we can remove its usage from MVC
|
|
||||||
public static class DispatcherServiceCollectionExtensions
|
|
||||||
{
|
|
||||||
// This whole class is temporary until we can remove its usage from MVC
|
|
||||||
public static IServiceCollection AddDispatcher(this IServiceCollection services)
|
|
||||||
{
|
|
||||||
if (services == null)
|
|
||||||
{
|
|
||||||
throw new ArgumentNullException(nameof(services));
|
|
||||||
}
|
|
||||||
|
|
||||||
return services.AddRouting();
|
|
||||||
}
|
|
||||||
|
|
||||||
// This whole class is temporary until we can remove its usage from MVC
|
|
||||||
public static IServiceCollection AddDispatcher(this IServiceCollection services, Action<EndpointOptions> configuration)
|
|
||||||
{
|
|
||||||
if (services == null)
|
|
||||||
{
|
|
||||||
throw new ArgumentNullException(nameof(services));
|
|
||||||
}
|
|
||||||
|
|
||||||
services.AddRouting();
|
|
||||||
if (configuration != null)
|
|
||||||
{
|
|
||||||
services.Configure<EndpointOptions>(configuration);
|
|
||||||
}
|
|
||||||
|
|
||||||
return services;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue