Skip to main content

RouteAttribute

Used to decorate Request DTO's to associate a RESTful request path mapping with a service. Multiple attributes can be applied to each request DTO, to map multiple paths to the service.

Assembly: ServiceStack.Interfaces.dll
View Source
Declaration
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class RouteAttribute : AttributeBase, _Attribute, IReflectAttributeConverter

Properties

Path

Gets or sets the path template to be mapped to the request.

View Source
Declaration
public string Path { get; set; }

Summary

Gets or sets short summary of what the route does.

View Source
Declaration
public string Summary { get; set; }

Notes

Gets or sets longer text to explain the behaviour of the route.

View Source
Declaration
public string Notes { get; set; }

Verbs

Gets or sets a comma-delimited list of HTTP verbs supported by the service, such as "GET,PUT,POST,DELETE".

View Source
Declaration
public string Verbs { get; set; }

Priority

Used to rank the precedences of route definitions in reverse routing. i.e. Priorities below 0 are auto-generated have less precedence.

View Source
Declaration
public int Priority { get; set; }

Matches

Must match rule defined in Config.RequestRules or Regex expression with format: "{IHttpRequest.Field} =~ {pattern}", e.g "PathInfo =~ \/[0-9]+$"

View Source
Declaration
public string Matches { get; set; }

Methods

Equals(RouteAttribute)

View Source
Declaration
protected bool Equals(RouteAttribute other)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.RouteAttributeother

Equals(Object)

View Source
Declaration
public override bool Equals(object obj)
Returns

System.Boolean

Parameters
TypeName
System.Objectobj

GetHashCode()

View Source
Declaration
public override int GetHashCode()
Returns

System.Int32

ToReflectAttribute()

View Source
Declaration
public ReflectAttribute ToReflectAttribute()
Returns

ServiceStack.ReflectAttribute

Implements