-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcblockedThe work on this issue is blocked due to some dependencyThe work on this issue is blocked due to some dependencyfeature-minimal-actionsController-like actions for endpoint routingController-like actions for endpoint routingold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone
Description
C# 11 introduces support for static abstract interface members. We should update the support for custom parameter binding via a static BindAsync
method in Minimal APIs to discover and invoke the BindAsync
method via a newly defined interface (see below). We would continue to support the existing discovery and invocation via reflection approach we introduced in .NET 6 to maintain backwards compatibility.
public interface IBindableFromHttpContext<TSelf>
where TSelf : class, IBindableFromHttpContext<TSelf>
{
static abstract ValueTask<TSelf?> BindAsync(HttpContext context, ParameterInfo parameter);
}
I welcome additional interface name suggestions 😄
martincostello and slang25marcominerva
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcblockedThe work on this issue is blocked due to some dependencyThe work on this issue is blocked due to some dependencyfeature-minimal-actionsController-like actions for endpoint routingController-like actions for endpoint routingold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels