Closed
Description
- Don't call the overloads "MapAction". Add overloads to the existing MapGet/MapPost/MapDelete/Map extension methods. We should remove the existing MapAction method.
namespace Microsoft.AspNetCore.Builder
{
public static class EndpointRouteBuilderExtensions
{
public static IEndpointConventionBuilder Map(this IEndpointRouteBuilder endpoints, string pattern, Delegate action);
public static IEndpointConventionBuilder MapGet(this IEndpointRouteBuilder endpoints, string pattern, Delegate action);
public static IEndpointConventionBuilder MapPost(this IEndpointRouteBuilder endpoints, string pattern, Delegate action);
public static IEndpointConventionBuilder MapPut(this IEndpointRouteBuilder endpoints, string pattern, Delegate action);
public static IEndpointConventionBuilder MapDelete(this IEndpointRouteBuilder endpoints, string pattern, Delegate action);
}
- Create overloads without the
string pattern
parameter for people you still want to useRouteAttribute
. This should throw anInvalidOperationException
if there's no route attribute.
namespace Microsoft.AspNetCore.Builder
{
public static class EndpointRouteBuilderExtensions
{
public static IEndpointConventionBuilder Map(this IEndpointRouteBuilder endpoints, Delegate action);
}
}