public void Delete(IEnumerable<Entity> entities) { if (entities == null) throw new ArgumentNullException("entities"); if (entities.Count() == 0) return; var batch = new GlobalBatch(cache, database); try { batch.Start(); foreach (var entity in entities) { if (entity is Artist) batch.DeleteArtist(entity as Artist); else if (entity is Work) batch.DeleteWork(entity as Work); } batch.Stop(); } finally { batch.Close(); } }
public void Delete(IEnumerable <Entity> entities) { if (entities == null) { throw new ArgumentNullException("entities"); } if (entities.Count() == 0) { return; } var batch = new GlobalBatch(cache, database); try { batch.Start(); foreach (var entity in entities) { if (entity is Artist) { batch.DeleteArtist(entity as Artist); } else if (entity is Work) { batch.DeleteWork(entity as Work); } } batch.Stop(); } finally { batch.Close(); } }