public void Invoke(ServiceArguments arguments, IDictionary<string, object> routeValues, IRequestCompletion requestCompletion) { var currentChain = new CurrentChain(_chain, routeValues); arguments.Set(typeof(ICurrentChain), currentChain); arguments.Set(typeof(IRequestCompletion), requestCompletion); if (arguments.Has(typeof (IChainExecutionLog))) { arguments.Get<IChainExecutionLog>().RootChain = _chain; } if (_chain.Filters.Any(filter => filter.Filter(arguments) == DoNext.Stop)) { return; } IActionBehavior behavior = null; if (arguments.Has(typeof (IChainExecutionLog))) { arguments.Get<IChainExecutionLog>().Trace("Building the Behaviors", () => { behavior = _factory.BuildBehavior(arguments, _chain.UniqueId); }); } else { behavior = _factory.BuildBehavior(arguments, _chain.UniqueId); } requestCompletion.WhenCompleteDo(x => { var disposable = behavior as IDisposable; if (disposable != null) { disposable.Dispose(); } }); behavior.Invoke(); }
public void Invoke(ServiceArguments arguments, IDictionary<string, object> routeValues, IRequestCompletion requestCompletion) { var currentChain = new CurrentChain(_chain, routeValues); arguments.Set(typeof(ICurrentChain), currentChain); arguments.Set(typeof(IRequestCompletion), requestCompletion); if (_chain.Filters.Any(filter => filter.Filter(arguments) == DoNext.Stop)) { return; } var behavior = _factory.BuildBehavior(arguments, _chain.UniqueId); requestCompletion.WhenCompleteDo(x => { var disposable = behavior as IDisposable; if (disposable != null) { disposable.Dispose(); } }); behavior.Invoke(); }
public void Invoke(TypeArguments arguments, IDictionary <string, object> routeValues, IRequestCompletion requestCompletion) { var currentChain = new CurrentChain(_chain, routeValues); arguments.Set(typeof(ICurrentChain), currentChain); arguments.Set(typeof(IRequestCompletion), requestCompletion); if (arguments.Has(typeof(IChainExecutionLog))) { arguments.Get <IChainExecutionLog>().RootChain = _chain; } if (_chain.Filters.Any(filter => filter.Filter(arguments) == DoNext.Stop)) { return; } IActionBehavior behavior = null; if (arguments.Has(typeof(IChainExecutionLog))) { arguments.Get <IChainExecutionLog>().Trace("Building the Behaviors", () => { behavior = _factory.BuildBehavior(arguments, _chain.UniqueId); }); } else { behavior = _factory.BuildBehavior(arguments, _chain.UniqueId); } requestCompletion.WhenCompleteDo(x => { var disposable = behavior as IDisposable; disposable?.Dispose(); }); behavior.Invoke(); }
public void Invoke(ServiceArguments arguments, IDictionary <string, object> routeValues, IRequestCompletion requestCompletion) { var currentChain = new CurrentChain(_chain, routeValues); arguments.Set(typeof(ICurrentChain), currentChain); arguments.Set(typeof(IRequestCompletion), requestCompletion); if (_chain.Filters.Any(filter => filter.Filter(arguments) == DoNext.Stop)) { return; } var behavior = _factory.BuildBehavior(arguments, _chain.UniqueId); requestCompletion.WhenCompleteDo(x => { var disposable = behavior as IDisposable; if (disposable != null) { disposable.Dispose(); } }); behavior.Invoke(); }
public AsyncCoordinator(IRequestCompletion requestCompletion, IEnumerable<IExceptionHandler> exceptionHandlers) { _requestCompletion = requestCompletion; _exceptionHandlers = exceptionHandlers; _requestCompletion.TrackRequestCompletionWith(this); }
public AsyncCoordinator(IRequestCompletion requestCompletion, IEnumerable <IExceptionHandler> exceptionHandlers) { _requestCompletion = requestCompletion; _exceptionHandlers = exceptionHandlers; _requestCompletion.TrackRequestCompletionWith(this); }