Skip to content

Commit 7315702

Browse files
authored
Merge pull request #6 from stevenrlp/main
Added DeleteRange and DeleteRangeAsync methods to EFCommandRepository
2 parents 4fdbbc7 + d99cad4 commit 7315702

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

source/EntityFrameworkCore/Repository/EFCommandRepository.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ public void Delete(Expression<Func<T, bool>> where)
3838

3939
public Task DeleteAsync(Expression<Func<T, bool>> where) => Task.Run(() => Delete(where));
4040

41+
public void DeleteRange(IEnumerable<T> items) => Set.RemoveRange(items);
42+
43+
public Task DeleteRangeAsync(IEnumerable<T> items) => Task.Run(() => DeleteRange(items));
44+
4145
public void Update(T item)
4246
{
4347
var primaryKeyValues = context.PrimaryKeyValues<T>(item);

source/EntityFrameworkCore/readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public class EFCommandRepository<T> : ICommandRepository<T> where T : class
4040

4141
public Task DeleteAsync(Expression<Func<T, bool>> where) { }
4242

43+
public void DeleteRange(IEnumerable<T> items) { }
44+
45+
public Task DeleteRangeAsync(IEnumerable<T> items) { }
46+
4347
public void Update(T item) { }
4448

4549
public Task UpdateAsync(T item) { }

0 commit comments

Comments
 (0)