Constructor Route
Route(RouteMethod, string, RouteAction)
Creates an new Route instance with given parameters.
public Route(RouteMethod method, string path, RouteAction 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
RouteActionThe function that is called after the route is matched with the request.
Route(RouteMethod, string, string?, RouteAction, IRequestHandler[]?)
Creates an new Route instance with given parameters.
public Route(RouteMethod method, string path, string? name, RouteAction 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
RouteActionThe 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()