13 Commits

Author SHA1 Message Date
agrynco b434383f7e Merge pull request 'release: IT-631 fix EF repository base bugs' (#12) from development into main 2026-05-06 12:50:16 +03:00
agrynco 3f1371e33a Merge pull request 'fix: use GetByIdAsync in DeleteAsync(TEntityId)' (#11) from IT-631-fix-delete-async-getbyid into development 2026-05-06 12:50:04 +03:00
Anatolii Grynchuk 9c1da388d8 fix: use GetByIdAsync in DeleteAsync(TEntityId)
Replaced sync GetById with await GetByIdAsync to avoid blocking the thread inside an async method.

Ref: #IT-631
2026-05-06 12:46:35 +03:00
agrynco 1edcafdebd Merge pull request 'fix: eliminate multi-save in batch Add and DeleteAsync(TEntityId)' (#10) from IT-631-fix-delete into development 2026-05-06 12:45:09 +03:00
Anatolii Grynchuk 93461fd35e fix: eliminate multi-save in batch Add and DeleteAsync(TEntityId)
- Add(TEntity[]) now passes save:false in the loop and calls SaveChanges once at the end
- DeleteAsync(TEntityId) now calls DoRemove directly instead of Delete(TEntityId) to avoid the double-save from the sync overload chain

Ref: #IT-631
2026-05-06 12:43:27 +03:00
agrynco 52c9c9ab9e Merge pull request 'chore: upgrade ef core 10.0.7' (#9) from development into main 2026-05-06 02:20:53 +03:00
Anatolii Grynchuk 4020981eec chore: upgrade ef core 8.0.15 -> 10.0.7
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 02:20:44 +03:00
agrynco d7b7c2eb88 Merge pull request 'chore: downgrade ef core 8.0.15' (#8) from development into main 2026-05-06 01:55:16 +03:00
Anatolii Grynchuk 2b02374b19 chore: downgrade ef core 9.0.5 -> 8.0.15
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 01:55:07 +03:00
agrynco c630db2582 Merge pull request 'docs: switch task management and wiki to gitea, merge to development only for non-release changes' (#7) from docs/gitea-workflow-agents into development 2026-05-06 01:29:15 +03:00
agrynco 1bab9c963d Merge pull request 'feat: rebuild base repository hierarchy, add readme and agents' (#6) from development into main 2026-05-06 01:16:30 +03:00
agrynco 6b68f099fa Merge pull request 'feat: expose UtcNow property on BaseDbContext' (#4) from development into main 2026-05-05 22:17:09 +03:00
agrynco b09777252b Merge pull request 'feat: add BaseDbContext, non-generic IEntity, fix Entity constructor' (#2) from development into main 2026-05-05 22:03:32 +03:00
2 changed files with 14 additions and 5 deletions
+3 -3
View File
@@ -6,8 +6,8 @@
<!-- HrynCo shared packages --> <!-- HrynCo shared packages -->
<PackageVersion Include="HrynCo.Common" Version="1.0.0" /> <PackageVersion Include="HrynCo.Common" Version="1.0.0" />
<!-- Entity Framework Core --> <!-- Entity Framework Core -->
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.5" /> <PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.5" /> <PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.5" /> <PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.7" />
</ItemGroup> </ItemGroup>
</Project> </Project>
+11 -2
View File
@@ -40,7 +40,12 @@ public abstract class BaseEfRepository<TDbContext, TEntity, TEntityId> :
{ {
foreach (TEntity entity in entities) 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) public async Task DeleteAsync(TEntityId id)
{ {
Delete(id); TEntity? entity = await GetByIdAsync(id);
if (entity != null)
{
DoRemove(entity);
}
await DbContext.SaveChangesAsync(); await DbContext.SaveChangesAsync();
} }