private void AddDefaultHandlerForAction(RouteHandler routes, MethodInfo info) { ManosAction action = ActionForMethod(info); ActionTarget target = new ActionTarget(action); AddImplicitRouteHandler(target, new string [] { "/" + info.Name }, HttpMethods.RouteMethods); }
private void AddHandlerForAction(RouteHandler routes, HttpMethodAttribute att, MethodInfo info) { ManosAction action = ActionForMethod(info); ActionTarget target = new ActionTarget(action); AddImplicitRouteHandler(target, att.Patterns, att.Methods); }
private void AddHandlerForAction(RouteHandler routes, HttpMethodAttribute att, MethodInfo info) { ManosAction action = ActionForMethod(info); ActionTarget target = new ActionTarget(action); string[] patterns = null == att.Patterns ? new string [] { "/" + info.Name } : att.Patterns; AddImplicitRouteHandlerForTarget(target, OpsForPatterns(patterns, att.MatchType), att.Methods); }
public void TestRouteNull() { var m = new MockManosModule(); ManosModule mm = null; Should.Throw <ArgumentNullException> (() => m.Route("foo", mm), "a1"); Should.Throw <ArgumentNullException> (() => m.Route(mm, "foo", "bar", "baz"), "a2"); ManosAction ma = null; Should.Throw <ArgumentNullException> (() => m.Route("foo", ma), "a3"); Should.Throw <ArgumentNullException> (() => m.Route(ma, "foo", "bar", "baz"), "a4"); mm = new MockManosModule(); Should.Throw <ArgumentNullException> (() => m.Route(null, mm), "a4"); Should.Throw <ArgumentNullException> (() => m.Route(mm, "foo", "bar", "baz", null), "a5"); ma = FakeAction; Should.Throw <ArgumentNullException> (() => m.Route(null, ma), "a6"); Should.Throw <ArgumentNullException> (() => m.Route(ma, "foo", "bar", "baz", null), "a7"); }
public RouteHandler Trace(string pattern, ManosAction action) { return AddRouteHandler (action, new string [] { pattern }, HttpMethods.TraceMethods); }
public RouteHandler Options(ManosAction action, params string [] patterns) { return AddRouteHandler (action, patterns, HttpMethods.OptionsMethods); }
public RouteHandler Options(string pattern, ManosAction action) { return AddRouteHandler (action, new string [] { pattern }, HttpMethods.OptionsMethods); }
private RouteHandler AddRouteHandler(ManosAction action, string [] patterns, HttpMethod [] methods) { return(AddRouteHandler(new ActionTarget(action), patterns, methods)); }
private RouteHandler AddRouteHandler(ManosAction action, IMatchOperation[] matchOperations, HttpMethod [] methods) { return(AddRouteHandler(new ActionTarget(action), matchOperations, methods)); }
private RouteHandler AddRouteHandler(ManosAction action, IMatchOperation[] matchOperations, HttpMethod [] methods) { return AddRouteHandler (new ActionTarget (action), matchOperations, methods); }
public RouteHandler Trace(string pattern, ManosAction action) { return(AddRouteHandler(action, new string [] { pattern }, HttpMethods.TraceMethods)); }
public RouteHandler Options(ManosAction action, params string [] patterns) { return(AddRouteHandler(action, patterns, HttpMethods.OptionsMethods)); }
public ActionTarget(ManosAction action) { Action = action; }
public RouteHandler Trace(string pattern, MatchType matchType, ManosAction action) { IMatchOperation [] ops = OpsForPatterns(new string [] { pattern }, matchType); return(AddRouteHandler(action, ops, HttpMethods.GetMethods)); }
public RouteHandler Trace(string pattern, MatchType matchType, ManosAction action) { IMatchOperation [] ops = OpsForPatterns (new string [] { pattern }, matchType); return AddRouteHandler (action, ops, HttpMethods.GetMethods); }
public RouteHandler Trace(ManosAction action, params string [] patterns) { return AddRouteHandler (action, patterns, HttpMethods.TraceMethods); }
public RouteHandler Trace(ManosAction action, params string [] patterns) { return(AddRouteHandler(action, patterns, HttpMethods.TraceMethods)); }
private RouteHandler AddRouteHandler(ManosAction action, string [] patterns, HttpMethod [] methods) { return AddRouteHandler (new ActionTarget (action), patterns, methods); }
public ActionTarget(ManosAction action) { Action = action; }