コード例 #1
0
        protected virtual void RenderNonEmptyTable(IEnumerable <T> rows, IEnumerable <ColumnMetadata> metadatas, ISampler <T> sampler, MarkdownContainer container)
        {
            var extendedDefinitions = BuildExtendedMetadatas(rows.ElementAt(0), metadatas);

            container.Append($"Result-set with {rows.Count()} row{(rows.Count() > 1 ? "s" : string.Empty)}".ToMarkdownParagraph());
            container.Append(new TableExtended()
            {
                Columns = RenderColumns(extendedDefinitions), Rows = RenderRows(Sampler.GetResult(), extendedDefinitions)
            });

            if (Sampler.GetIsSampled())
            {
                var rowsSkipped = $"{Sampler.GetExcludedRowCount()} (of {Rows.Count()}) rows have been skipped for display purpose.";
                container.Append(rowsSkipped.ToMarkdownParagraph());
            }
        }