Exemplo n.º 1
0
        private void DeleteRow(RowId rowId)
        {
            int timestamp = TableSnapshot <TRecord> .Timestamp();

            foreach (List <IIndex <TRecord> > list in this.table.Indexes)
            {
                if (list != null)
                {
                    foreach (IIndex <TRecord> index in list)
                    {
                        if (index.Timestamp != timestamp)
                        {
                            index.Delete(rowId);
                            index.Timestamp = timestamp;
                        }
                    }
                }
            }
            this.table.Delete(rowId);
        }
Exemplo n.º 2
0
        public RowId Insert(ref TRecord data)
        {
            this.ValidateModification();
            RowId rowId     = this.table.Insert(ref data);
            int   timestamp = TableSnapshot <TRecord> .Timestamp();

            foreach (List <IIndex <TRecord> > list in this.table.Indexes)
            {
                if (list != null)
                {
                    foreach (IIndex <TRecord> index in list)
                    {
                        if (index.Timestamp != timestamp)
                        {
                            index.Insert(rowId);
                            index.Timestamp = timestamp;
                        }
                    }
                }
            }
            return(rowId);
        }