Aktualisiert IRepository<TEntity> um UpdateAsync<TDto>, DeleteAsync<TDto> und eine neue Überladung von ReadAsync. Die frühere ReadAsync-Überladung für Core.Tests.Mock.User wurde entfernt.
Einführung einer neuen Extensions-Klasse mit Methoden für ReadFirstOrDefaultAsync, ReadFirstAsync, ReadSingleOrDefaultAsync und ReadSingleAsync unter Nutzung der aktualisierten ReadAsync-Methode.
- Added ReadAsync method to IRepository for user retrieval.
- Introduced _userRepo field in DbRepositoryTests for better clarity.
- Modified Setup method to initialize _userRepo from the service provider.
- Updated CreateAsync_ShouldNotThrow to use _userRepo.
- Added ReadAsync_ShouldReturnCreated test for user retrieval validation.
Updated IRepository<TEntity> to include new generic methods for creating and reading entities from DTOs. Modified UpdateAsync to accept DTOs instead of generic types. Implemented corresponding methods in DbRepository<TDbContext, TEntity> for mapping DTOs to entities during creation and updating processes.
Updated the `IRepository<TEntity>` interface to include two new mapping methods: `Map<TSource>(TSource source)` and `Map<TDto>(TEntity source)`.
Implemented these methods in the `DbRepository<TDbContext, TEntity>` class, utilizing a `Mapper` for conversions between source types and entity types, as well as between entity types and DTOs.
- Incremented version numbers in project files for updates.
- Marked `ICRUDRepository` as obsolete; use `IRepository` instead.
- Improved parameter names and signatures in `IRepository`.
- Changed access modifiers in `DbRepository` for broader access.
- Updated `CreateAsync` and `UpdateAsync` methods for async operations.
- Implemented `ReadAsync` and `DeleteAsync` methods in `DbRepository`.
- Minor whitespace change in `.csproj` files.
- Retained package description in `DigitalData.Core.Infrastructure.csproj`.
Updated IRepository<TEntity> to remove generic type parameters
from CreateAsync methods, now directly accepting TEntity.
Corresponding changes made in DbRepository to align method
signatures. Implementations still throw NotImplementedException.
Updated the IRepository<TEntity> interface to include an optional CancellationToken parameter in the asynchronous methods: CreateAsync, ReadAsync, UpdateAsync, and DeleteAsync. Modified the DbRepository<TDbContext, TEntity> class to align with these changes, ensuring method signatures are consistent with the interface.
Die `ICRUDRepository`-Schnittstelle wurde als veraltet markiert, was bedeutet, dass sie zugunsten der neuen `IRepository`-Schnittstelle abgelehnt wird. Die „IRepository“-Schnittstelle bietet eine verbesserte Abstraktion und Flexibilität, die Methoden zum Erstellen, Lesen, Aktualisieren und Löschen von Entitäten mit Unterstützung für asynchrone Operationen umfasst.
Eine neue asynchrone CountAsync-Methode wurde zum Repository-Interface und zur Implementierung hinzugefügt. Diese Methode zählt die Anzahl der Entitäten mit einer bestimmten ID in der Datenbank.
- `IUnique<TId>` Einschränkung zu `TEntity` in den Schnittstellen `ICRUDService`, `CRUDService`, `ICRUDRepository` und `CRUDRepository` hinzugefügt.
- Relevanten Code aktualisiert, um die neue Einschränkung zu berücksichtigen und sicherzustellen, dass Entitäten `IUnique<TId>` implementieren.
- ReadAll-Methode zur ICRUDRepository-Schnittstelle hinzugefügt, um die Abfrage aller Entitäten zu ermöglichen.
- ReadAll-Methode in der CRUDRepository-Klasse implementiert, um IQueryable<TEntity> für weitere Abfragen und Filterung bereitzustellen.