Skip to content

Commit

Permalink
Added a RemoveWhereAsync method
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanHair committed Sep 21, 2023
1 parent c2b91de commit 787cf57
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/RepositoryBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ public Task DeleteAsync(T entity, CancellationToken cancellationToken = default)
return Db.SaveChangesAsync();
}

public Task DeleteWhereAsync(Expression<Func<T, bool>> predicate, CancellationToken cancellationToken = default)
{
Entities.RemoveRange(Entities.Where(predicate));
return Db.SaveChangesAsync();
}

public Task ApplyChanges(CancellationToken cancellationToken = default)
{
return Db.SaveChangesAsync();
Expand Down

0 comments on commit 787cf57

Please sign in to comment.