Compare commits
10 Commits
4020981eec
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| b434383f7e | |||
| 3f1371e33a | |||
| 9c1da388d8 | |||
| 1edcafdebd | |||
| 93461fd35e | |||
| 52c9c9ab9e | |||
| d7b7c2eb88 | |||
| 1bab9c963d | |||
| 6b68f099fa | |||
| b09777252b |
@@ -40,7 +40,12 @@ public abstract class BaseEfRepository<TDbContext, TEntity, TEntityId> :
|
||||
{
|
||||
foreach (TEntity entity in entities)
|
||||
{
|
||||
Add(entity, save);
|
||||
Add(entity, save: false);
|
||||
}
|
||||
|
||||
if (save)
|
||||
{
|
||||
DbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +89,11 @@ public abstract class BaseEfRepository<TDbContext, TEntity, TEntityId> :
|
||||
|
||||
public async Task DeleteAsync(TEntityId id)
|
||||
{
|
||||
Delete(id);
|
||||
TEntity? entity = await GetByIdAsync(id);
|
||||
if (entity != null)
|
||||
{
|
||||
DoRemove(entity);
|
||||
}
|
||||
await DbContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user