Add MapPatch overloads to routing #36198
Labels
api-approved
API was approved in API review, it can be implemented
area-minimal
Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
area-web-frameworks
feature-minimal-actions
Controller-like actions for endpoint routing
feature-routing
good first issue
Good for newcomers.
Milestone
Background and Motivation
Today we have shortcuts for the most common HTTP methods for route handling (GET, POST, PUT, DELETE) but we don't have PATCH (or OPTIONS, TRACE, HEAD). We should add MapPatch to the set of methods we support. MapPatch is also interesting because people can now write custom binders in minimal APIs to handle the body. Today calling MapMethods(..) is the workaround (https://github.com/felipeoriani/MinimalBlogApi/blob/83732f1785a4c01a63ccf6909ca2a8190c63b4c9/Program.cs#L118) but it's kinda gross.
Proposed API
namespace Microsoft.AspNetCore.Builder { public static class DelegateEndpointRouteBuilderExtensions { + public static DelegateEndpointConventionBuilder MapPatch(this IEndpointRouteBuilder endpoints, string pattern, Delegate handler); } }
Usage Examples
Risks
Low.
Questions:
The text was updated successfully, but these errors were encountered: