示例#1
0
        private string invokeWrapped(Type requestType)
        {
            var chain   = _resolver.FindUniqueByType(requestType);
            var partial = _factory.BuildPartial(chain);

            return(_writer.Record(partial.InvokePartial).GetText());
        }
示例#2
0
        public virtual IRecordedOutput CreateOuput(string resourceHash, Action <IActionBehavior> innerInvocation)
        {
            var newOutput = _writer.Record(() => innerInvocation(_inner));

            newOutput.ForHeader(HttpResponseHeaders.ETag, etag => _etagCache.Register(resourceHash, etag));

            return(newOutput);
        }
示例#3
0
        public virtual IRecordedOutput CreateOutput(string resourceHash, Action invocation)
        {
            var newOutput = _writer.Record(invocation);

            _headersCache.Register(resourceHash, newOutput.Headers());

            return(newOutput);
        }
示例#4
0
        private void handleInvokation(Action invokation)
        {
            var model = _request.Get <TInputModel>();

            _cache.WithCache(model,
                             requestModel => _writer.Record(invokation),
                             cachedData => _writer.Write(cachedData.RecordedContentType, cachedData.Content));
        }
示例#5
0
        private string invokeWrapped(Type requestType, string categoryOrHttpMethod = null)
        {
            var chain   = _resolver.FindUniqueByType(requestType, category: categoryOrHttpMethod ?? Categories.VIEW);
            var partial = _factory.BuildPartial(chain);
            var output  = _writer.Record(partial.InvokePartial);

            output.Headers().Each(x => _writer.AppendHeader(x.Name, x.Value));
            return(output.GetText());
        }
        public RecordedOutput Record(Action action)
        {
            var recordedOuput = _inner.Record(action);

            _report.AddDetails(new OutputReport()
            {
                Contents    = recordedOuput.Content,
                ContentType = recordedOuput.RecordedContentType
            });


            return(recordedOuput);
        }
示例#7
0
        public void Invoke()
        {
            var output = _writer.Record(() => _inner.Invoke());

            var subject = new T {
                InnerContent = output.GetText()
            };

            _customization(subject);

            var html = _partials.InvokeObject(subject);

            _writer.WriteHtml(html);
        }
示例#8
0
        public string GetText(Type requestType)
        {
            var partial = buildPartial(requestType);

            return(_writer.Record(partial.InvokePartial).GetText());
        }
示例#9
0
        private string invokeWrapped(Type requestType)
        {
            var partial = _factory.BuildPartial(requestType);

            return(_writer.Record(partial.InvokePartial).GetText());
        }