using System; namespace EmbedIO.Routing { partial class RoutingModuleExtensions { /// /// Adds a handler to a . /// /// The on which this method is called. /// A constant representing the HTTP method /// to associate with , or /// if can handle all HTTP methods. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// /// public static RoutingModule Handle(this RoutingModule @this, HttpVerbs verb, RouteMatcher matcher, RouteHandlerCallback handler) { @this.Add(verb, matcher, handler); return @this; } /// /// Adds a synchronous handler to a . /// /// The on which this method is called. /// A constant representing the HTTP method /// to associate with , or /// if can handle all HTTP methods. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// /// public static RoutingModule Handle(this RoutingModule @this, HttpVerbs verb, RouteMatcher matcher, SyncRouteHandlerCallback handler) { @this.Add(verb, matcher, handler); return @this; } /// /// Associates all requests matching a route to a handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnAny(this RoutingModule @this, RouteMatcher matcher, RouteHandlerCallback handler) { @this.Add(HttpVerbs.Any, matcher, handler); return @this; } /// /// Associates all requests matching a route to a synchronous handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnAny(this RoutingModule @this, RouteMatcher matcher, SyncRouteHandlerCallback handler) { @this.Add(HttpVerbs.Any, matcher, handler); return @this; } /// /// Associates DELETE requests matching a route to a handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnDelete(this RoutingModule @this, RouteMatcher matcher, RouteHandlerCallback handler) { @this.Add(HttpVerbs.Delete, matcher, handler); return @this; } /// /// Associates DELETE requests matching a route to a synchronous handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnDelete(this RoutingModule @this, RouteMatcher matcher, SyncRouteHandlerCallback handler) { @this.Add(HttpVerbs.Delete, matcher, handler); return @this; } /// /// Associates GET requests matching a route to a handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnGet(this RoutingModule @this, RouteMatcher matcher, RouteHandlerCallback handler) { @this.Add(HttpVerbs.Get, matcher, handler); return @this; } /// /// Associates GET requests matching a route to a synchronous handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnGet(this RoutingModule @this, RouteMatcher matcher, SyncRouteHandlerCallback handler) { @this.Add(HttpVerbs.Get, matcher, handler); return @this; } /// /// Associates HEAD requests matching a route to a handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnHead(this RoutingModule @this, RouteMatcher matcher, RouteHandlerCallback handler) { @this.Add(HttpVerbs.Head, matcher, handler); return @this; } /// /// Associates HEAD requests matching a route to a synchronous handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnHead(this RoutingModule @this, RouteMatcher matcher, SyncRouteHandlerCallback handler) { @this.Add(HttpVerbs.Head, matcher, handler); return @this; } /// /// Associates OPTIONS requests matching a route to a handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnOptions(this RoutingModule @this, RouteMatcher matcher, RouteHandlerCallback handler) { @this.Add(HttpVerbs.Options, matcher, handler); return @this; } /// /// Associates OPTIONS requests matching a route to a synchronous handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnOptions(this RoutingModule @this, RouteMatcher matcher, SyncRouteHandlerCallback handler) { @this.Add(HttpVerbs.Options, matcher, handler); return @this; } /// /// Associates PATCH requests matching a route to a handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnPatch(this RoutingModule @this, RouteMatcher matcher, RouteHandlerCallback handler) { @this.Add(HttpVerbs.Patch, matcher, handler); return @this; } /// /// Associates PATCH requests matching a route to a synchronous handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnPatch(this RoutingModule @this, RouteMatcher matcher, SyncRouteHandlerCallback handler) { @this.Add(HttpVerbs.Patch, matcher, handler); return @this; } /// /// Associates POST requests matching a route to a handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnPost(this RoutingModule @this, RouteMatcher matcher, RouteHandlerCallback handler) { @this.Add(HttpVerbs.Post, matcher, handler); return @this; } /// /// Associates POST requests matching a route to a synchronous handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnPost(this RoutingModule @this, RouteMatcher matcher, SyncRouteHandlerCallback handler) { @this.Add(HttpVerbs.Post, matcher, handler); return @this; } /// /// Associates PUT requests matching a route to a handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnPut(this RoutingModule @this, RouteMatcher matcher, RouteHandlerCallback handler) { @this.Add(HttpVerbs.Put, matcher, handler); return @this; } /// /// Associates PUT requests matching a route to a synchronous handler. /// /// The on which this method is called. /// The used to match URL paths. /// A callback used to handle matching contexts. /// with the handler added. /// is . /// /// is . /// - or - /// is . /// public static RoutingModule OnPut(this RoutingModule @this, RouteMatcher matcher, SyncRouteHandlerCallback handler) { @this.Add(HttpVerbs.Put, matcher, handler); return @this; } } }