CompiledRoute Compile(Route route) { Events.Compile(route); try { // Setting all flags for the compiler assuming this will only be invoked at runtime. Func <IMessage, Bool> evaluate = this.compiler.Compile(route, RouteCompilerFlags.All); var result = new CompiledRoute(route, evaluate); Events.CompileSuccess(route); return(result); } catch (Exception ex) { Events.CompileFailure(route, ex); throw; } }
static bool EvaluateInternal(CompiledRoute compiledRoute, IMessage message) { try { Bool evaluation = compiledRoute.Evaluate(message); if (evaluation.Equals(Bool.Undefined)) { Routing.UserAnalyticsLogger.LogUndefinedRouteEvaluation(message, compiledRoute.Route); } return(evaluation); } catch (Exception ex) { Events.EvaluateFailure(compiledRoute.Route, ex); throw; } }