示例#1
0
        private static SchemaFieldDecl[] ComputeColumnSchema(IList <IList <string> > value)
        {
            var titleRow = value.FirstOrDefault();

            if (titleRow == null)
            {
                return(new SchemaFieldDecl[0]);
            }
            var namer = new NameSpace();

            return(titleRow.Select((i, count) =>
                                   new SchemaFieldDecl(namer.Rename(i), ComputeType(
                                                           value.Select(j => j[count]).Skip(1)
                                                           ))).ToArray());
        }
示例#2
0
        private static SchemaFieldDecl[] ComputeColumnSchema(IList <IList <string> > value)
        {
            var titleRow = value.FirstOrDefault();

            if (titleRow == null)
            {
                return(new SchemaFieldDecl[0]);
            }
            var namer = new NameSpace();

            return(titleRow.Select((columnName, columnIndex) =>
                                   new SchemaFieldDecl(namer.Rename(columnName),
                                                       ComputeType(DataForColumnByIndex(value, columnIndex))))
                   .ToArray());
        }