Class RestRoute
Defines a route for a collection of REST stores.
Inheritance
Namespace: EPiServer.Shell.Services.Rest
Assembly: EPiServer.Shell.dll
Version: 7.19.2Syntax
public class RestRoute : RouteBase
Constructors
RestRoute(String, IRouteHandler)
Initializes a new instance of the Rest
Declaration
public RestRoute(string url, IRouteHandler routeHandler)
Parameters
Type | Name | Description |
---|---|---|
System. |
url | The base url for the contained stores. |
System. |
routeHandler | The route handler handling requests mapped to this route. |
RestRoute(String, IRouteHandler, IServiceLocator)
Initializes a new instance of the Rest
Declaration
public RestRoute(string url, IRouteHandler routeHandler, IServiceLocator serviceLocator)
Parameters
Type | Name | Description |
---|---|---|
System. |
url | The base url for the contained stores. |
System. |
routeHandler | The route handler handling requests mapped to this route. |
IService |
serviceLocator | The service locator providing controller instances. |
Properties
AppRelativeUrl
The Url mapped to the application root.
Declaration
public string AppRelativeUrl { get; }
Property Value
Type | Description |
---|---|
System. |
RouteHandler
Gets or sets the route handler.
Declaration
public IRouteHandler RouteHandler { get; }
Property Value
Type | Description |
---|---|
System. |
The route handler. |
Stores
A collection of registered stores mapped to the route path.
Declaration
public IDictionary<string, Type> Stores { get; }
Property Value
Type | Description |
---|---|
System. |
Url
Gets or sets the URL for which this route is registered.
Declaration
public string Url { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
Equals(Object)
Compares against another route.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System. |
obj | The route to compare. |
Returns
Type | Description |
---|---|
System. |
true if the compared object has the same url. |
GetHashCode()
Gets the hash code.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System. |
A hash code based on the route url. |
GetRouteData(HttpContextBase)
When overridden in a derived class, returns route information about the request.
Declaration
public override RouteData GetRouteData(HttpContextBase httpContext)
Parameters
Type | Name | Description |
---|---|---|
System. |
httpContext | An object that encapsulates information about the HTTP request. |
Returns
Type | Description |
---|---|
System. |
An object that contains the values from the route definition if the route matches the current request, or null if the route does not match the request. |
GetVirtualPath(RequestContext, RouteValueDictionary)
Checks whether the route matches the specified values, and if so, generates a URL and retrieves information about the route.
Declaration
public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values)
Parameters
Type | Name | Description |
---|---|---|
System. |
requestContext | An object that encapsulates information about the requested route. |
System. |
values | An object that contains the parameters for a route. |
Returns
Type | Description |
---|---|
System. |
This implementation always returns null |
TryCreateController(String, out IController)
Try to create a controller mapped to a store by the registered store name.
Declaration
public virtual bool TryCreateController(string storeName, out IController controller)
Parameters
Type | Name | Description |
---|---|---|
System. |
storeName | Name of the store. |
System. |
controller | The created controller controller. |
Returns
Type | Description |
---|---|
System. |
true if a controller was found and successfully created; otherwise false. |