public RequestLog BuildForCurrentRequest()
        {
            var report = new ValueReport();
            _requestData.WriteReport(report);

            var chainId = _currentChain.OriginatingChain == null ? Guid.Empty :
                _currentChain.OriginatingChain.UniqueId;
            var log = new RequestLog{
                ChainId    = chainId,
                Time = _systemTime.UtcNow(),
                RequestData = report,
                //ChainUrl = _urls.UrlFor(new ChainRequest{Id = chainId}),
                //DetailsUrl = _urls.UrlFor(new ChainDetailsRequest{Id = chainId})
            };

            if (_currentChain.OriginatingChain.Route != null)
            {
                log.HttpMethod = _request.HttpMethod();
                log.Endpoint = _request.RelativeUrl();
            }
            else if (_currentChain.OriginatingChain.InputType() != null)
            {
                log.Endpoint = _currentChain.OriginatingChain.InputType().FullName;
                log.HttpMethod = "n/a";
            }
            else
            {
                log.Endpoint = ChainVisualization.TitleForChain(_currentChain.OriginatingChain);
                log.HttpMethod = "n/a";
            }

            //log.ReportUrl = _urls.UrlFor(log);

            return log;
        }
        public HtmlTag RequestDataPartial(ValueReport report)
        {
            var tag = new HtmlTag("div").Id("request-data");

            var dataTags = report.Reports.Where(x => x.Values.Any()).Select(toTag);

            tag.Append(dataTags);

            return tag;
        }
        public RequestLog BuildForCurrentRequest()
        {
            var report = new ValueReport();
            _requestData.WriteReport(report);

            var chainId = _currentChain.OriginatingChain.UniqueId;
            var log = new RequestLog{
                ChainId    = chainId,
                HttpMethod = _request.HttpMethod(),
                Url = _request.RelativeUrl(),
                Time = _systemTime.UtcNow(),
                RequestData = report,
                ChainUrl = _urls.UrlFor(new ChainRequest{Id = chainId}),
                DetailsUrl = _urls.UrlFor(new ChainDetailsRequest{Id = chainId})
            };

            log.ReportUrl = _urls.UrlFor(log);

            return log;
        }