diff --git a/CHANGELOG.md b/CHANGELOG.md index a541ab7..130a809 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ### CsuChhs.DataTools +#### 1.0.3 +- Added bulk insert action that removes save changes. + #### 1.0.2 - Bumped min EF core version to 9.0 diff --git a/CsuChhs.DataTools/CsuChhs.DataTools.csproj b/CsuChhs.DataTools/CsuChhs.DataTools.csproj index 4e3b8be..8c7e0ee 100644 --- a/CsuChhs.DataTools/CsuChhs.DataTools.csproj +++ b/CsuChhs.DataTools/CsuChhs.DataTools.csproj @@ -6,7 +6,7 @@ enable true CHHS Application Development Team - 1.0.2 + 1.0.3 https://github.com/csu-chhs/CsuChhs.DataTools College of Health and Human Sciences CsuChhs.DataTools diff --git a/CsuChhs.DataTools/DAL/EntityRepository.cs b/CsuChhs.DataTools/DAL/EntityRepository.cs index 2488f89..0263191 100644 --- a/CsuChhs.DataTools/DAL/EntityRepository.cs +++ b/CsuChhs.DataTools/DAL/EntityRepository.cs @@ -20,6 +20,12 @@ public T Add(T entity) return entity; } + public T AddBulk(T entity) + { + _dbContext.Set().Add(entity); + return entity; + } + public IQueryable AllQueryable() { return _dbContext.Set(); @@ -31,6 +37,11 @@ public void Delete(T entity) _dbContext.SaveChanges(); } + public void SaveChanges() + { + _dbContext.SaveChanges(); + } + public void Update(T entity) { _dbContext.Entry(entity).State = EntityState.Modified; diff --git a/CsuChhs.DataTools/Interfaces/IRepository.cs b/CsuChhs.DataTools/Interfaces/IRepository.cs index 91b1380..78e4f00 100644 --- a/CsuChhs.DataTools/Interfaces/IRepository.cs +++ b/CsuChhs.DataTools/Interfaces/IRepository.cs @@ -8,5 +8,7 @@ public interface IRepository where T : BaseModel void Update(T entity); void Delete(T entity); T Add(T entity); + T AddBulk(T entity); + void SaveChanges(); } } \ No newline at end of file