public static TabularJsonString ToTabularJsonString <T>(this IEnumerable <T> source)
        {
            var(schema, data) = Generate(source);
            var tabularDataSet = new TabularDataSet(schema, data);

            return(tabularDataSet.ToJson());
        }
Пример #2
0
        public static TabularJsonString Create(IReadOnlyDictionary <string, Type> fields, IEnumerable data)
        {
            var schema = new TabularDataSchema();

            foreach (var entry in fields)
            {
                schema.Fields.Add(new TabularDataSchemaField(entry.Key, entry.Value.ToTableFieldType()));
            }
            var tabularDataSet = new TabularDataSet(schema, data);

            return(tabularDataSet.ToJson());
        }