6 Commits

Author SHA1 Message Date
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
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
Anatolii Grynchuk 15c58522ef feat: rebuild base repository hierarchy, add readme and agents
- replace EfRepository/BaseDbContext/UtcValueConverter with BaseEfRepository and BaseRepository
- add IEfRepository interface hierarchy
- consolidate IEntity into Entity.cs, remove standalone IEntity.cs
- add PagedResult
- adjust all namespaces to HrynCo.DAL.Abstract / HrynCo.DAL.EF
- add README.md with solution overview, versioning rules, class diagram
- add AGENTS.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 01:15:59 +03:00
Anatolii Grynchuk 4fac3ddba9 feat: expose UtcNow property on BaseDbContext
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-05 22:16:53 +03:00
Anatolii Grynchuk 6be7a0ceed feat: add BaseDbContext, non-generic IEntity, fix Entity constructor
- add non-generic IEntity with Created/Updated only
- IEntity<TId> now extends IEntity
- remove Created = DateTimeOffset.UtcNow from Entity constructor
- add BaseDbContext with ApplyTimestamps, UtcValueConverter, DeleteBehavior.Restrict
- add UnexpectedEntityStateException
- add HrynCo.Common dependency to HrynCo.DAL.EF

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-05 22:02:30 +03:00
Anatolii Grynchuk d254873172 feat: initial solution with HrynCo.DAL.Abstract and HrynCo.DAL.EF
- HrynCo.DAL.Abstract: IEntity<TId>, Entity base classes, ITransaction, IUnitOfWork
- HrynCo.DAL.EF: EfRepository<TDbContext,TEntity>, EfUnitOfWork<TDbContext>, EfTransactionAdapter
- Directory.Packages.props with centralized EF Core 9.0.5 versions
- TeamCity pipeline YAMLs for general-checks and publish

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-05 18:52:18 +03:00