Class
RouteAttribute
Represents an class that, when applied to a method, will be recognized by a router as a route.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public class RouteAttribute : AttributeInheritance #
object ← Attribute ← RouteAttribute
Derived #
RegexRouteAttribute, RouteDeleteAttribute, RouteGetAttribute, RoutePatchAttribute, RoutePostAttribute, RoutePutAttribute, RouteQueryAttribute
Inherited Members #
Attribute.GetCustomAttributes(MemberInfo, Type), Attribute.GetCustomAttributes(MemberInfo, Type, bool), Attribute.GetCustomAttributes(MemberInfo), Attribute.GetCustomAttributes(MemberInfo, bool), Attribute.IsDefined(MemberInfo, Type), Attribute.IsDefined(MemberInfo, Type, bool), Attribute.GetCustomAttribute(MemberInfo, Type), Attribute.GetCustomAttribute(MemberInfo, Type, bool), Attribute.GetCustomAttributes(ParameterInfo), Attribute.GetCustomAttributes(ParameterInfo, Type), Attribute.GetCustomAttributes(ParameterInfo, Type, bool), Attribute.GetCustomAttributes(ParameterInfo, bool), Attribute.IsDefined(ParameterInfo, Type), Attribute.IsDefined(ParameterInfo, Type, bool), Attribute.GetCustomAttribute(ParameterInfo, Type), Attribute.GetCustomAttribute(ParameterInfo, Type, bool), Attribute.GetCustomAttributes(Module, Type), Attribute.GetCustomAttributes(Module), Attribute.GetCustomAttributes(Module, bool), Attribute.GetCustomAttributes(Module, Type, bool), Attribute.IsDefined(Module, Type), Attribute.IsDefined(Module, Type, bool), Attribute.GetCustomAttribute(Module, Type), Attribute.GetCustomAttribute(Module, Type, bool), Attribute.GetCustomAttributes(Assembly, Type), Attribute.GetCustomAttributes(Assembly, Type, bool), Attribute.GetCustomAttributes(Assembly), Attribute.GetCustomAttributes(Assembly, bool), Attribute.IsDefined(Assembly, Type), Attribute.IsDefined(Assembly, Type, bool), Attribute.GetCustomAttribute(Assembly, Type), Attribute.GetCustomAttribute(Assembly, Type, bool), Attribute.Equals(object?), Attribute.GetHashCode(), Attribute.Match(object?), Attribute.IsDefaultAttribute(), Attribute.TypeId, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors #
| Name | Description |
|---|---|
| RouteAttribute(RouteMethod, string) | Creates an new RouteAttribute instance with given route method and path pattern. |
Properties #
| Name | Description |
|---|---|
| LogMode | Gets or sets how this route can write messages to log files on the server. |
| Method | Gets or sets the matching HTTP method. If it is “Any”, the route will just use the path expression to be matched, not the HTTP method. |
| Name | Gets or sets the route name. It allows it to be found by other routes and makes it easier to create links. |
| Path | Gets or sets the path expression that will be interpreted by the router and validated by the requests. |
| 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. |