Updated the version number, assembly version, and file version for the DigitalData.Core.Application project from 3.3.0 to 3.3.1 in DigitalData.Core.Application.csproj.
Modified the CreateAsync method in CRUDService.cs and ICRUDService.cs to change the return type from DataResult<TId> to DataResult<TReadDto>. The implementation now maps the created entity to a read DTO, providing the caller with the complete entity representation instead of just its ID.
Updated the `UpdateAsync<TUpdateDto>` method in `CRUDService.cs` to replace the use of `GetIdOrDefault<TId>()` with `GetId<TId>()`. This change ensures that an ID must be present in the `updateDto`, enhancing the reliability of the update process.
Modified the `GetId<TId>` method in the `EntityExtensions` class to change its return type from nullable `TId?` to non-nullable `TId`, ensuring stricter type safety by throwing an `InvalidOperationException` when the `Id` property is not readable.
Removed a summary comment in the `ICRUDService` interface related to the `CreateAsync` method, which may indicate ongoing documentation updates for clarity on the method's functionality and parameters.
Updated `IRepository<TEntity>` to introduce new reading methods and mark existing ones as obsolete. The `CRUDRepository` class is now deprecated, encouraging a transition to alternative implementations. Significant changes in `DbRepository<TDbContext, TEntity>` include the removal of old read methods in favor of a new `Read` method returning `IReadQuery<TEntity>`. Added a `ReadQuery<TEntity>` class to enhance querying capabilities with a fluent API. Obsolete methods are organized under a `#region Obsolete` directive for better management.
The ICRUDRepository interface has been marked as obsolete,
with an attribute advising users to use IRepository instead.
This change aims to direct developers towards a preferred
alternative for repository operations.
Updated the IReadQuery<TEntity> interface to include an optional CancellationToken parameter for the following asynchronous methods:
- FirstOrDefaultAsync
- SingleOrDefaultAsync
- ToListAsync
- FirstAsync
- SingleAsync
Documentation comments for these methods have also been updated to describe the new cancellation parameter and its purpose.
Updated parameter names from `ct` to `cancellation` in several asynchronous methods of the `IRepository<TEntity>` interface. This change improves code readability and clarity. Affected methods include `CreateAsync`, `UpdateAsync`, `DeleteAsync`, `ReadAllAsync`, `ReadOrDefaultAsync`, and their generic counterparts.
Updated the IRepository<TEntity> interface to include an overloaded CreateAsync method for handling multiple entities and removed the CancellationToken from the Read method. Introduced a new RepositoryExtensions class with a Where extension method to facilitate applying multiple filters to IReadQuery<TEntity> queries.
Updated the `IRepository<TEntity>` interface in `IRepository.cs` to include new asynchronous methods for reading, updating, and deleting entities. Added `Read`, `UpdateAsync`, and `DeleteAsync` methods while marking several existing methods as obsolete to encourage the use of the new `Read` method returning `IReadQuery<TEntity>`. Removed previous implementations of `UpdateAsync` and `DeleteAsync` for a more streamlined API.
Updated XML documentation in ConfigurationExtension.cs for better clarity.
Removed the old implementation and retained the functionality of GetOrDefault<T>.
Introduced a new IReadQuery<TEntity> interface in IReadQuery.cs,
providing methods for both asynchronous and synchronous entity queries,
along with comprehensive documentation for each method.
Added `[Obsolete("Use MediatR")]` attributes to various controller and service classes to indicate deprecation in favor of MediatR. Simplified generic type constraints in `CRUDControllerBase` and related files by removing `IUnique<TId>`. Improved structure and documentation in `CSPMiddleware.cs`. Introduced new extension methods in `EntityExtensions.cs` for safer retrieval of 'Id' properties. Removed `IUnique.cs` interface and updated project dependencies in `DigitalData.Core.Application.csproj` for caching. Overall, these changes enhance code maintainability and clarity.
This commit reorganizes namespaces from `DigitalData.Core.Abstractions` and `DigitalData.Core.DTO` to `DigitalData.Core.Application.Interfaces` and `DigitalData.Core.Application.DTO`, improving maintainability and clarity.
Updated using directives across multiple files to reflect the new structure, ensuring functionality remains intact.
Project references in `DigitalData.Core.API.csproj` have been consolidated to include the new Application project.
Introduced new classes and interfaces such as `BaseDTO`, `CookieConsentSettings`, `DataResult`, `Notice`, and `Result` to enhance data transfer and service result handling.
Updated `IRepository`, `ICRUDRepository`, and `IEntityMapper` interfaces to facilitate CRUD operations and entity mapping.
Added extension methods in `Extensions.cs` to improve repository usability.
New interfaces for HTTP client services have been added, enhancing external API call handling.
Overall, these changes reflect a significant restructuring aimed at improving organization and preparing for future development.
- 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`.
- Added conditional package references for AutoMapper in
`DigitalData.Core.Application.csproj` to support
different target framework versions.
- Changed `DbRepository` class access modifier from
`public` to `internal` to encapsulate implementation
details within the current assembly.
Updated multiple project files to support .NET 9.0 alongside .NET 7.0 and .NET 8.0. Affected files include:
- DigitalData.Core.API.csproj
- DigitalData.Core.Abstractions.csproj
- DigitalData.Core.Application.csproj
- DigitalData.Core.Client.csproj
- DigitalData.Core.DTO.csproj
- DigitalData.Core.Infrastructure.csproj
This change enables the use of new features and improvements in .NET 9.0.
- Entfernen redundanter generischer Einschränkungen für `TUpdateDto` in `CRUDService`.
- Aktualisierung der Methode `UpdateAsync`, um einen generischen Parameter für eine bessere Typflexibilität von `TUpdateDto` einzuschließen.
- Verbesserung der Typ-Einschränkungen durch Durchsetzung von `IUnique<TId>` direkt im Methodenumfang, wo zutreffend.
- Vereinfachung der Klasse zur Einhaltung bewährter Praktiken im Design generischer Dienste.
- Aktualisiertes IBasicCRUDService-Interface, um Konsistenz bei einzigartigen Identifikatoren mit IUnique<TId> durchzusetzen
- DIExtensions-Methoden angepasst, um IUnique<TId>-Einschränkungen für DTOs und Entitäten einzuschließen
Die Implementierung der HasEntity-Methode wurde ersetzt, um die CountAsync-Methode des Repositories zu verwenden. Dies sorgt für eine effizientere Überprüfung der Existenz von Entitäten.
- Entfernte `_keyPropertyInfo` und die zugehörige Methode `KeyValueOf`, da sie nicht mehr benötigt wird.
- Aktualisierte `CreateAsync` Methode, um direkt `createdEntity.Id` zurückzugeben.
- `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.
- `MapOrThrow` auf `Map` für das Mapping von DTOs in `CRUDService` geändert.
- Methoden-Signaturen und interne Logik angepasst, um die aktualisierten `Map`-Methoden zu verwenden.
- Ausnahmebehandlung und ID-Abruffunktionalität beibehalten.
- Eine Überprüfung hinzugefügt, um sicherzustellen, dass die Entität vor dem Aktualisieren existiert.
- Eine Warnung wird protokolliert, wenn die Entität im Aktualisierungsprozess nicht gefunden wird.
- Das `updateDto` wird auf die bestehende Entität gemappt, anstatt eine neue zu erstellen.
- Aktualisiert: `ICRUDService` und `CRUDService`, um die `IUnique<TId>`-Einschränkung für `TUpdateDto` sicherzustellen, dass Update-Datenübertragungsobjekte eine eindeutige Kennung enthalten.
- Neue DTO-Extension-Methoden hinzugefügt, um die Verarbeitung und Zuweisung von Nachrichten und Benachrichtigungen in Ergebnisobjekten zu vereinfachen.
- Lokalisierungsunterstützung in der API-Schicht implementiert, einschließlich Cookie-basierter Lokalisierung und Konfiguration unterstützter Kulturen.
- Die Integration von StringLocalizer in die API-Schicht wurde durchgeführt, um eine nahtlose Mehrsprachigkeit zu ermöglichen.
- Fehlerbehandlung für fehlende Konfigurationseinstellungen verbessert.
Die Änderungen verbessern die Flexibilität und Wartbarkeit des Codes und unterstützen eine effizientere Internationalisierung der Anwendung.