protected bool ValidateMethodSignature(RouteKinds kind, MethodInfo mi) { switch (kind) { case RouteKinds.Decide: if (!DelegateCheck.IsCompatible(DecideType, mi)) { throw new ArgumentException(string.Format("method {0}.{1} does note have the required method signature", _actualType.Name, mi.Name)); } break; case RouteKinds.Guard: if (!DelegateCheck.IsCompatible(GuardType, mi)) { throw new ArgumentException(string.Format("method {0}.{1} does note have the required method signature", _actualType.Name, mi.Name)); } break; case RouteKinds.Invoke: if (!DelegateCheck.IsCompatible(InvokeType, mi)) { throw new ArgumentException(string.Format("method {0}.{1} does note have the required method signature", _actualType.Name, mi.Name)); } break; default: break; } return(true); }
public virtual IEnumerable <string> ListRoutes(RouteKinds kinds = RouteKinds.All) { var routes = Enumerable.Empty <string>(); if (kinds.HasFlag(RouteKinds.Invoke)) { routes = routes.Concat(_invokes.Keys); } if (kinds.HasFlag(RouteKinds.Guard)) { routes = routes.Concat(_guards.Keys); } if (kinds.HasFlag(RouteKinds.Decide)) { routes = routes.Concat(_decides.Keys); } return(routes); }
public ExposeRouteAttribute(RouteKinds kind) { Kind = kind; RouteEndPoint = null; }
public ExposeRouteAttribute(RouteKinds kind, string routeEndPoint) { Kind = kind; RouteEndPoint = routeEndPoint; }