File tree Expand file tree Collapse file tree
source/EasyWay.EntityFrameworkCore Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ public interface IGenericRepository<TAggregateRoot>
55 {
66 Task Add ( TAggregateRoot aggregateRoot ) ;
77
8+ Task Add ( IEnumerable < TAggregateRoot > aggregateRoots ) ;
9+
810 Task < TAggregateRoot ? > Get ( Guid id ) ;
11+
12+ Task Remove ( TAggregateRoot aggregateRoot ) ;
13+
14+ Task Remove ( IEnumerable < TAggregateRoot > aggregateRoots ) ;
915 }
1016}
Original file line number Diff line number Diff line change @@ -17,9 +17,28 @@ public Task Add(TAggregateRoot aggregateRoot)
1717 return _aggregateRoots . AddAsync ( aggregateRoot ) . AsTask ( ) ;
1818 }
1919
20+ public Task Add ( IEnumerable < TAggregateRoot > aggregateRoots )
21+ {
22+ return _aggregateRoots . AddRangeAsync ( aggregateRoots ) ;
23+ }
24+
2025 public Task < TAggregateRoot ? > Get ( Guid id )
2126 {
2227 return _aggregateRoots . FindAsync ( id ) . AsTask ( ) ;
2328 }
29+
30+ public Task Remove ( TAggregateRoot aggregateRoot )
31+ {
32+ _aggregateRoots . Remove ( aggregateRoot ) ;
33+
34+ return Task . CompletedTask ;
35+ }
36+
37+ public Task Remove ( IEnumerable < TAggregateRoot > aggregateRoots )
38+ {
39+ _aggregateRoots . RemoveRange ( aggregateRoots ) ;
40+
41+ return Task . CompletedTask ;
42+ }
2443 }
2544}
You can’t perform that action at this time.
0 commit comments