Skip to main content

IServiceRoutes

Allow the registration of user-defined routes for services

Assembly: ServiceStack.Interfaces.dll​
View Source​
Declaration
public interface IServiceRoutes

Methods​

Add<TRequest>(String)​

Maps the specified REST path to the specified request DTO.

View Source​
Declaration
IServiceRoutes Add<TRequest>(string restPath)
Returns​

ServiceStack.Web.IServiceRoutes: The same ServiceStack.Web.IServiceRoutes instance; never null.

Parameters​
TypeNameDescription
System.StringrestPathThe path to map the request DTO to.
See ``ServiceStack.RouteAttribute.Path?text=RouteAttribute.Path``
for details on the correct format.

|

Type Parameters​
NameDescription
TRequestThe type of request DTO to map
the path to.

Add<TRequest>(String, String)​

Maps the specified REST path to the specified request DTO, and specifies the HTTP verbs supported by the path.

View Source​
Declaration
IServiceRoutes Add<TRequest>(string restPath, string verbs)
Returns​

ServiceStack.Web.IServiceRoutes: The same ServiceStack.Web.IServiceRoutes instance; never null.

Parameters​
TypeNameDescription
System.StringrestPathThe path to map the request DTO to.
See ``ServiceStack.RouteAttribute.Path?text=RouteAttribute.Path``
for details on the correct format.

| | System.String | verbs | The comma-delimited list of HTTP verbs supported by the path, such as "GET,PUT,DELETE". Specify empty or null to indicate that all verbs are supported.

|

Type Parameters​
NameDescription
TRequestThe type of request DTO to map
the path to.

Add(Type, String, String)​

Maps the specified REST path to the specified request DTO, specifies the HTTP verbs supported by the path, and indicates the default MIME type of the returned response.

View Source​
Declaration
IServiceRoutes Add(Type requestType, string restPath, string verbs)
Returns​

ServiceStack.Web.IServiceRoutes: The same ServiceStack.Web.IServiceRoutes instance; never null.

Parameters​
TypeNameDescription
System.TyperequestType

The type of request DTO to map the path to.

| | System.String | restPath | The path to map the request DTO to. See ServiceStack.RouteAttribute.Path?text=RouteAttribute.Path for details on the correct format.

| | System.String | verbs | The comma-delimited list of HTTP verbs supported by the path, such as "GET,PUT,DELETE".

|

Add(Type, String, String, Int32)​

Maps the specified REST path to the specified request DTO, specifies the HTTP verbs supported by the path, and indicates the default MIME type of the returned response.

View Source​
Declaration
IServiceRoutes Add(Type requestType, string restPath, string verbs, int priority)
Returns​

ServiceStack.Web.IServiceRoutes

Parameters​
TypeNameDescription
System.TyperequestType
System.StringrestPath
System.Stringverbs
System.Int32priority

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

|

Add(Type, String, String, String, String)​

Maps the specified REST path to the specified request DTO, specifies the HTTP verbs supported by the path, and indicates the default MIME type of the returned response.

View Source​
Declaration
IServiceRoutes Add(Type requestType, string restPath, string verbs, string summary, string notes)
Returns​

ServiceStack.Web.IServiceRoutes: The same ServiceStack.Web.IServiceRoutes instance; never null.

Parameters​
TypeNameDescription
System.TyperequestType

The type of request DTO to map the path to.

| | System.String | restPath | The path to map the request DTO to. See ServiceStack.RouteAttribute.Path?text=RouteAttribute.Path for details on the correct format.

| | System.String | verbs | The comma-delimited list of HTTP verbs supported by the path, such as "GET,PUT,DELETE".

| | System.String | summary | The short summary of what the REST does.

| | System.String | notes | The longer text to explain the behaviour of the REST.

|

Add(Type, String, String, String, String, String)​

Maps the specified REST path to the specified request DTO, specifies the HTTP verbs supported by the path, and indicates the default MIME type of the returned response.

View Source​
Declaration
IServiceRoutes Add(Type requestType, string restPath, string verbs, string summary, string notes, string matches)
Returns​

ServiceStack.Web.IServiceRoutes: The same ServiceStack.Web.IServiceRoutes instance; never null.

Parameters​
TypeNameDescription
System.TyperequestType

The type of request DTO to map the path to.

| | System.String | restPath | The path to map the request DTO to. See ServiceStack.RouteAttribute.Path?text=RouteAttribute.Path for details on the correct format.

| | System.String | verbs | The comma-delimited list of HTTP verbs supported by the path, such as "GET,PUT,DELETE".

| | System.String | summary | The short summary of what the REST does.

| | System.String | notes | The longer text to explain the behaviour of the REST.

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

|