예제 #1
0
        protected override DoNext performInvoke()
        {
            var input = _request.Find <TInput>().Single();

            _action(_controller, input);
            return(DoNext.Continue);
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
        protected override DoNext performInvoke()
        {
            _request.Find <IHaveHeaders>()
            .SelectMany(x => x.Headers)
            .Each(x => x.Write(_writer));

            return(DoNext.Continue);
        }
예제 #5
0
        protected override DoNext performInvoke()
        {
            var message = _request.Find <ConnegMessage>().FirstOrDefault();

            _writer.Write("text/html", "Message:" + message.Id);

            return(DoNext.Continue);
        }
예제 #6
0
        protected override DoNext performInvoke()
        {
            var continuation = _request.Find <AjaxContinuation>().Single();

            _writer.Write(continuation.ToDictionary(), MimeType.Json.ToString());

            return(DoNext.Continue);
        }
예제 #7
0
        protected override DoNext performInvoke()
        {
            var input  = _request.Find <TInput>().Single();
            var output = _func(_handler, input);

            _asyncHandling.Push(output);

            return(DoNext.Continue);
        }
예제 #8
0
        protected override DoNext performInvoke()
        {
            var input  = _request.Find <TInput>().Single();
            var output = _action(_handler, input);

            _messages.EnqueueCascading(output);

            return(DoNext.Continue);
        }
예제 #9
0
        public FubuContinuation FindContinuation()
        {
            var redirectable = _request.Find <IRedirectable>().FirstOrDefault();

            if (redirectable != null)
            {
                return(redirectable.RedirectTo ?? FubuContinuation.NextBehavior());
            }

            return(_request.Get <FubuContinuation>());
        }
예제 #10
0
        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()));
            });
        }
예제 #11
0
        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);
        }
예제 #12
0
        public void BindSettingsProperties()
        {
            var viewModel = _request.Find <TOutputModel>().First();

            _container.BuildUp(viewModel);
        }
예제 #13
0
 public void WriteHeaders()
 {
     _request.Find <IHaveHeaders>()
     .SelectMany(x => x.Headers)
     .Each(x => x.Write(_writer));
 }
예제 #14
0
 public void SetModel(IFubuRequest request)
 {
     _model = request.Find <TMasterPageViewModel>().FirstOrDefault();
 }