Exemplo n.º 1
0
 public static ITable CreateTable(ITable source)
 {
     var meta = new Metadata();
     var cols = new List<IColumn>(source.Columns.Count);
     cols.AddRange(source.Columns.Select(t => CreateColumn(t.GetType().GetGenericArguments()[0], null)));
     source.Metadata.KeyCols.ToList().ForEach(k => meta.KeyCols.Add(k));
     return new Table
         (
             meta, new List<IRow>(), cols
         );
 }
Exemplo n.º 2
0
 public static ITable CreateTable(int columns, IEnumerable<int> keys)
 {
     var meta = new Metadata();
     var cols = new List<IColumn>(columns);
     for(var i= 0; i<columns; i++)cols.Add(new Column<string>());
     keys.ToList().ForEach(k => meta.KeyCols.Add(k));
     return new Table
         (
             meta, new List<IRow>(), cols
         );
 }