-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Extend the ability to customize parameter binding for Minimal APIs #35489
Copy link
Copy link
Open
Labels
Needs: DesignThis issue requires design work before implementating.This issue requires design work before implementating.api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-minimal-actionsController-like actions for endpoint routingController-like actions for endpoint routingtriage-focusAdd this label to flag the issue for focus at triageAdd this label to flag the issue for focus at triage
Milestone
Metadata
Metadata
Assignees
Labels
Needs: DesignThis issue requires design work before implementating.This issue requires design work before implementating.api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-minimal-actionsController-like actions for endpoint routingController-like actions for endpoint routingtriage-focusAdd this label to flag the issue for focus at triageAdd this label to flag the issue for focus at triage
Type
Fields
Give feedbackNo fields configured for Feature.
This issue is to discuss future updates to extend the ability to customize parameter binding for Minimal APIs, beyond what's available in .NET 6, i.e. static methods
bool TryParse(string input, out T value)andValueTask<object> BindAsync(HttpContext httpContext)on the target type.These are some features of parameter binding to consider:
TryParsein .NET 6)BindAsyncin .NET 6)IParameterBinder<T>in DI([Binder(typeof(CustomerBinder))]Customer customer) => { }BindAsyncin .NET 6 now)Strawman
Example usage:
Related issues: