Delegate TypedRequestHandlerDelegate<TRequestContext>
Represents a typed request handler in the router pipeline.
Namespace: NanoRoute
Assembly: NanoRoute.dll
Syntax
public delegate Task<HttpResponseMessage> TypedRequestHandlerDelegate<TRequestContext>(TRequestContext requestContext, CallNextHandlerDelegate callNext) where TRequestContext : new()
Parameters
| Type | Name | Description |
|---|---|---|
| TRequestContext | requestContext | The typed request object built from the current RequestContext. |
| CallNextHandlerDelegate | callNext | A delegate that invokes the next compatible handler in the pipeline. |
Returns
| Type | Description |
|---|---|
| Task<HttpResponseMessage> | The response produced by the current handler, or by a later handler when |
Type Parameters
| Name | Description |
|---|---|
| TRequestContext | The request-object type populated from the current route parameters, query bindings, services, and special framework values. |
Remarks
This delegate is used by NanoRouteHandlerExtensions overloads that expose CallNextHandlerDelegate. Exceptions thrown by the handler propagate through the routing pipeline unless middleware handles them.
Examples
builder.AddHandler<UserRequest>("GET", "/users/{id:int}/*", (request, next) => next());