public void Dispose(IUpdateImplementer <T> updater) { for (var index = 0; index < _entities.Count; index++) { var item = _entities[index]; updater.Dispose(item.Key, item.Value); } _entities.Clear(); _entitiesAsDict.Clear(); }
private void RemoveDeletedItems(IUpdateImplementer <T> updater) { for (var index = 0; index < _entities.Count; index++) { var kvpCreated = _entities[index]; if (!updater.HasEntityWithId(kvpCreated.Key)) { var item = _entities[index]; updater.Dispose(item.Key, item.Value); _entities.RemoveAt(index); _entitiesAsDict.Remove(kvpCreated.Key); index--; } } }