Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Sealed class: RT.Servers.UrlMapping

Summary

Encapsulates a mapping from URLs to a request handler. Add instances of this class to a UrlResolver to map URL paths or domains to request handlers. This class is immutable.

Constructors

UrlMapping(UrlHook hook, Func<HttpRequest, HttpResponse> handler, bool skippable = false)
Initialises a new UrlMapping.
UrlMapping(Func<HttpRequest, HttpResponse> handler, string domain = null, int? port = null, string path = null, bool specificDomain = false, bool specificPath = false, bool skippable = false)

Instance methods

int Compares this mapping to another one, and returns a value indicating which mapping should be checked for a match first. The ordering is such that more specific mappings are checked first, so that they trigger even if a more generic mapping encompasses the specific one. Hence skippable mappings are treated exactly the same, and are only reordered with respect to the single non-skippable mapping that matches the exact same request.
bool Compares mappings for equality. Two mappings are equal if UrlMapping.Hook and UrlMapping.Skippable are equal; UrlMapping.Handler is ignored.
bool
Equals(object obj)
  • Overrides: object.Equals(object)
int
  • Overrides: object.GetHashCode()
Computes a hash code suitable as a heuristic for the kind of equality defined by UrlMapping.Equals(object).
string
  • Overrides: object.ToString()
Returns a debugging-friendly representation of this hook's match specification.

Instance properties

Func<HttpRequest, HttpResponse>Gets the request handler for this mapping.
UrlHookGets the hook that determines which URLs can trigger the UrlMapping.Handler.
bool Gets a value indicating whether the UrlMapping.Handler may return null, in which case it will be skipped and another applicable handler executed instead. Skippable handlers may have a hook identical to that of other handlers.