File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed
Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 11### CsuChhs.DataTools
22
3+ #### 1.0.3
4+ - Added bulk insert action that removes save changes.
5+
36#### 1.0.2
47- Bumped min EF core version to 9.0
58
Original file line number Diff line number Diff line change 66 <Nullable >enable</Nullable >
77 <GeneratePackageOnBuild >true</GeneratePackageOnBuild >
88 <Authors >CHHS Application Development Team</Authors >
9- <Version >1.0.2 </Version >
9+ <Version >1.0.3 </Version >
1010 <PackageProjectUrl >https://github.com/csu-chhs/CsuChhs.DataTools</PackageProjectUrl >
1111 <Company >College of Health and Human Sciences</Company >
1212 <PackageId >CsuChhs.DataTools</PackageId >
Original file line number Diff line number Diff line change @@ -20,6 +20,12 @@ public T Add(T entity)
2020 return entity ;
2121 }
2222
23+ public T AddBulk ( T entity )
24+ {
25+ _dbContext . Set < T > ( ) . Add ( entity ) ;
26+ return entity ;
27+ }
28+
2329 public IQueryable < T > AllQueryable ( )
2430 {
2531 return _dbContext . Set < T > ( ) ;
@@ -31,6 +37,11 @@ public void Delete(T entity)
3137 _dbContext . SaveChanges ( ) ;
3238 }
3339
40+ public void SaveChanges ( )
41+ {
42+ _dbContext . SaveChanges ( ) ;
43+ }
44+
3445 public void Update ( T entity )
3546 {
3647 _dbContext . Entry ( entity ) . State = EntityState . Modified ;
Original file line number Diff line number Diff line change @@ -8,5 +8,7 @@ public interface IRepository<T> where T : BaseModel
88 void Update ( T entity ) ;
99 void Delete ( T entity ) ;
1010 T Add ( T entity ) ;
11+ T AddBulk ( T entity ) ;
12+ void SaveChanges ( ) ;
1113 }
1214}
You can’t perform that action at this time.
0 commit comments