-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Update RouteHandlerFilterContext.Parameters
API
#40514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Moving this back into .NET 7 Planning to prioritize completing the performance tests in #40655 for preview3. |
Thanks for contacting us. We're moving this issue to the |
We've added performance tests for some basic scenarios with minimal APIs and route handler filters.
All the route handlers above tested on a string input/output for the route handler. While testing other input/output types might provide more "real world" values, the bare scenario is sufficient for observing the net impact of the barebones filters logic. All told, adding a filter to an endpoint reduces throughput (measured in RPS) by about 9%. There's generally a bigger impact when adding parameters to an endpoint filter and parameter processing is a larger cost in the process than endpoint filters. Regardless of the perf impact, IMO, this work is relevant to pursue because exposing parameters as an untyped list is 🤢 . |
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
API Review Notes:
- public sealed class RouteHandlerInvocationContext
+ public abstract class RouteHandlerInvocationContext
{
- public RouteHandlerInvocationContext(HttpContext httpContext, params object[] parameters)
- public HttpContext HttpContext { get; }
+ public abstract HttpContext HttpContext { get; }
- public IList<object?> Parameters { get; }
+ public abstract IList<object?> Arguments { get; }
+ public abstract T GetArgument<T>(int index) { }
}
+ public class DefaultRouteHandlerInvocationContext : RouteHandlerInvocationContext
+ {
+ public RouteHandlerInvocationContext(HttpContext httpContext, params object[] parameters)
+
+ public override HttpContext HttpContext { get; }
+ public override IList<object?> Arguments { get; }
+ public override T GetArgument<T>(int index) { }
+ } |
Follow-up to #40491
The text was updated successfully, but these errors were encountered: