Exemple #1
0
        public void DeleteEntity(E entity)
        {
            var entities       = stream.ReadAll().ToList();
            var entityToRemove = entities.SingleOrDefault(ent => ent.GetId().CompareTo(entity.GetId()) == 0);

            if (entityToRemove != null)
            {
                entities.Remove(entityToRemove);
                stream.SaveAll();
            }
        }
Exemple #2
0
 public void InitializeId()
 => _sequencer.Initialize(GetMaxId(_stream.ReadAll()));