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(); } }
public void InitializeId() => _sequencer.Initialize(GetMaxId(_stream.ReadAll()));