Ejemplo n.º 1
0
        public List <ITable> GetWithAllData()
        {
            var joined = Tables.ToLookup(_ => _.Name, _ => _);
            var result = new List <ITable>();

            foreach (var z in joined)
            {
                var tables = z.ToList();
                var t      = new InMemoryTable(tables[0]);
                for (var i = 1; i < tables.Count; i++)
                {
                    foreach (var tr in tables[i].Rows)
                    {
                        t.Rows.Add(tr);
                    }
                }
                result.Add(t);
            }
            foreach (var t in result)
            {
                foreach (var row in t.Rows)
                {
                    Array.Resize(ref row.Columns, t.Fields.Count);
                }
            }
            return(result);
        }
Ejemplo n.º 2
0
 public ITable New(EntityClass entity, bool isTopTable, bool isLeafTable, int primaryKeyIndex)
 {
     lock (this)
     {
         var table = new InMemoryTable(entity, isTopTable, isLeafTable, primaryKeyIndex);
         Tables.Add(table);
         return(table);
     }
 }