revert to using Contains()

Join() was super slow...
ref #357
This commit is contained in:
Collin M. Barrett 2018-08-20 11:54:08 -05:00
parent 8b00cf5ed6
commit b5f83647d9
2 changed files with 2 additions and 2 deletions

View file

@ -15,7 +15,7 @@ namespace FilterLists.Services.Snapshot
{
public class Snapshot
{
private const int BatchSize = 250;
private const int BatchSize = 1000;
private readonly FilterListsDbContext dbContext;
private readonly FilterListViewUrlDto list;
private readonly Data.Entities.Snapshot snapEntity;

View file

@ -33,7 +33,7 @@ public async Task SaveAsync()
}
private IQueryable<Rule> GetExistingRules() =>
dbContext.Rules.Join(lines, rule => rule.Raw, line => line, (rule, line) => rule);
dbContext.Rules.Where(r => lines.Contains(r.Raw));
private List<Rule> CreateNewRules(IQueryable<Rule> existingRules) =>
lines.Except(existingRules.Select(r => r.Raw)).Select(r => new Rule {Raw = r}).ToList();