Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d7b7c2eb88 | |||
| 1bab9c963d | |||
| 6b68f099fa | |||
| b09777252b |
@@ -6,8 +6,8 @@
|
||||
<!-- HrynCo shared packages -->
|
||||
<PackageVersion Include="HrynCo.Common" Version="1.0.0" />
|
||||
<!-- Entity Framework Core -->
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.7" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.7" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.7" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.15" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.15" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.15" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -40,12 +40,7 @@ public abstract class BaseEfRepository<TDbContext, TEntity, TEntityId> :
|
||||
{
|
||||
foreach (TEntity entity in entities)
|
||||
{
|
||||
Add(entity, save: false);
|
||||
}
|
||||
|
||||
if (save)
|
||||
{
|
||||
DbContext.SaveChanges();
|
||||
Add(entity, save);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,11 +84,7 @@ public abstract class BaseEfRepository<TDbContext, TEntity, TEntityId> :
|
||||
|
||||
public async Task DeleteAsync(TEntityId id)
|
||||
{
|
||||
TEntity? entity = GetById(id);
|
||||
if (entity != null)
|
||||
{
|
||||
DoRemove(entity);
|
||||
}
|
||||
Delete(id);
|
||||
await DbContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user