protected override DoNext performInvoke() { var input = _request.Find <TInput>().Single(); _action(_controller, input); return(DoNext.Continue); }
protected override void invoke(Action action) { var message = _request.Find <TMessage>().FirstOrDefault(); if (message == null) { throw new Exception(String.Format("Message of type {0} is required.", typeof(TMessage))); } _handler.State = _repository.Find(message); action(); if (_handler.State == null) { return; } if (_handler.IsCompleted()) { _repository.Delete(_handler.State, message); } else { _repository.Save(_handler.State, message); } }
protected override async Task invoke(Func <Task> func) { var message = _request.Find <TMessage>().FirstOrDefault(); if (message == null) { throw new Exception($"Message of type {typeof(TMessage)} is required."); } _handler.State = _repository.Find(message); await func().ConfigureAwait(false); if (_handler.State == null) { return; } if (_handler.IsCompleted()) { _repository.Delete(_handler.State, message); } else { _repository.Save(_handler.State, message); } }
protected override DoNext performInvoke() { _request.Find <IHaveHeaders>() .SelectMany(x => x.Headers) .Each(x => x.Write(_writer)); return(DoNext.Continue); }
protected override DoNext performInvoke() { var message = _request.Find <ConnegMessage>().FirstOrDefault(); _writer.Write("text/html", "Message:" + message.Id); return(DoNext.Continue); }
protected override DoNext performInvoke() { var continuation = _request.Find <AjaxContinuation>().Single(); _writer.Write(continuation.ToDictionary(), MimeType.Json.ToString()); return(DoNext.Continue); }
protected override DoNext performInvoke() { var input = _request.Find <TInput>().Single(); var output = _func(_handler, input); _asyncHandling.Push(output); return(DoNext.Continue); }
protected override DoNext performInvoke() { var input = _request.Find <TInput>().Single(); var output = _action(_handler, input); _messages.EnqueueCascading(output); return(DoNext.Continue); }
public FubuContinuation FindContinuation() { var redirectable = _request.Find <IRedirectable>().FirstOrDefault(); if (redirectable != null) { return(redirectable.RedirectTo ?? FubuContinuation.NextBehavior()); } return(_request.Get <FubuContinuation>()); }
public TopicTreeBuilder(IUrlRegistry urls, IFubuRequest request) { _urls = urls; _topic = new Lazy <TopicNode>(() => { var topic = request.Find <Topic>().FirstOrDefault(); if (topic == null) { return(null); } var graph = TopicGraph.AllTopics; return(graph.Find(topic.GetType())); }); }
protected override DoNext performInvoke() { var model = _request.Find <EditEntityModel>().Single(); if (model.Target.IsNew()) { model.SubmitAction = _urls.UrlFor(model); } else { model.PropertyUpdateUrl = _urls.UrlForPropertyUpdate(model.EntityType); } return(DoNext.Continue); }
public void BindSettingsProperties() { var viewModel = _request.Find <TOutputModel>().First(); _container.BuildUp(viewModel); }
public void WriteHeaders() { _request.Find <IHaveHeaders>() .SelectMany(x => x.Headers) .Each(x => x.Write(_writer)); }
public void SetModel(IFubuRequest request) { _model = request.Find <TMasterPageViewModel>().FirstOrDefault(); }