Constructor Route
Route(RouteMethod, string, Delegate?)
Creates an new Route instance with given parameters.
public Route(RouteMethod method, string path, Delegate? action)
Parameters
method
RouteMethodThe matching HTTP method. If it is "Any", the route will just use the path expression to be matched, not the HTTP method.
path
stringThe path expression that will be interpreted by the router and validated by the requests.
action
DelegateThe function that is called after the route is matched with the request.
Route(RouteMethod, string, string?, Delegate?, IRequestHandler[]?)
Creates an new Route instance with given parameters.
public Route(RouteMethod method, string path, string? name, Delegate? action, IRequestHandler[]? beforeCallback)
Parameters
method
RouteMethodThe matching HTTP method. If it is "Any", the route will just use the path expression to be matched, not the HTTP method.
path
stringThe path expression that will be interpreted by the router and validated by the requests.
name
stringThe route name. It allows it to be found by other routes and makes it easier to create links.
action
DelegateThe function that is called after the route is matched with the request.
beforeCallback
IRequestHandler[]The RequestHandlers to run before the route's Action.
Route()
Creates an new Route instance with no parameters.
public Route()