Class RouteParser
Parses a route into an array of ISegment.
Inheritance
System.Object
RouteParser
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Web.Routing
Assembly: EPiServer.dll
Version: 9.12.2Syntax
[ServiceConfiguration(ServiceType = typeof(IRouteParser))]
public class RouteParser : IRouteParser
Constructors
RouteParser()
Declaration
public RouteParser()
Methods
Parse(String, IDictionary<String, ISegment>)
Parses the specified URL into segments.
Declaration
public ISegment[] Parse(string url, IDictionary<string, ISegment> segmentMappings)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | The URL to parse. |
System.Collections.Generic.IDictionary<System.String, ISegment> | segmentMappings | The dictionary to use when mapping segments. |
Returns
Type | Description |
---|---|
ISegment[] | An array of segments corresponding to the sections of |
Remarks
Will split the incoming url on '/' to create different sections.
The sections will each be matched against segmentMappings
to add the matching ISegment to the return array.
If no match is found it will add an instance of ParameterSegment.
If a section contains no curly braces an instance of StaticSegment will be added.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | When a specific segment is invalid. |