Class Route
Represents an HTTP route to be matched by an Router.
public class Route : IEquatable<Route>
- Inheritance
-
Route
- Implements
- Derived
- Inherited Members
Constructors
- Route(RouteMethod, string, Delegate?)
Creates an new Route instance with given parameters.
- Route(RouteMethod, string, string?, Delegate?, IRequestHandler[]?)
Creates an new Route instance with given parameters.
Fields
- AnyPath
Represents an route path which captures any URL path.
Properties
- Action
Gets or sets the function that is called after the route is matched with the request.
- Bag
Gets or sets an TypedValueDictionary for this route, which can hold contextual variables for this Route object.
- BypassGlobalRequestHandlers
Gets or sets the global request handlers instances that will not run on this route.
- LogMode
Gets or sets how this route can write messages to log files on the server.
- Method
Gets or sets the matching HTTP method.
- Name
Gets or sets the route name.
- Path
Gets or sets the path expression that will be interpreted by the router and validated by the requests.
- RequestHandlers
Gets or sets the request handlers instances to run before the route's Action.
- UseCors
Gets or sets whether this route should send Cross-Origin Resource Sharing headers in the response.
- UseRegex
Get or sets if this route should use regex to be interpreted instead of predefined templates.
Methods
- Any(string, RouteAction)
Creates a route that responds to any HTTP request method.
- Delete(string, RouteAction)
Creates a route that responds to HTTP DELETE requests.
- Get(string, RouteAction)
Creates a route that responds to HTTP GET requests.
- Head(string, RouteAction)
Creates a route that responds to HTTP HEAD requests.
- Options(string, RouteAction)
Creates a route that responds to HTTP OPTIONS requests.
- Patch(string, RouteAction)
Creates a route that responds to HTTP PATCH requests.
- Post(string, RouteAction)
Creates a route that responds to HTTP POST requests.
- Put(string, RouteAction)
Creates a route that responds to HTTP PUT requests.
- ToString()
Gets an string notation for this Route object.