public int Delete(List <RowHash> hashes) { var idHashes = hashes.Select(rh => rh.IdHash).ToList(); var entities = DbSet.Where(x => idHashes.Contains(x.IdHash)); DbSet.RemoveRange(entities); DbContext.SaveChanges(); entities.ToList().ForEach(e => Reporter.ReportDeleted(Entity, e.IdHash, e.Id)); return(entities.Count()); }
public int Delete(List <RowHash> hashes) { var idHashes = hashes.Select(rh => rh.IdHash).ToList(); var entities = _dbContext.PokemonForms .Where(x => idHashes.Contains(x.IdHash)); _dbContext.PokemonForms.RemoveRange(entities); _dbContext.SaveChanges(); DeleteOrphans(); entities.ToList().ForEach(e => _reporter.ReportDeleted(Entity.PokemonForm, e.IdHash, e.Id)); return(entities.Count()); }