513 Commits

Author SHA1 Message Date
Developer 02
5e2ebd07db Update NuGet package description for clarity
Modified the description in the `DigitalData.Core.Abstractions.csproj` file to provide a more concise statement about the package, removing details about Clean Architecture principles.
2025-05-20 10:44:56 +02:00
Developer 02
43e714b061 Update package references by target framework version
Modified `DigitalData.Core.Abstractions.csproj` to conditionally include package references for `Microsoft.Extensions.Caching.Memory` and `Microsoft.Extensions.Configuration.Binder` based on the target framework (`net7.0`, `net8.0`, `net9.0`). This change enhances compatibility and version management for different .NET versions.
2025-05-20 10:44:28 +02:00
Developer 02
7a7f564f82 Bump version to 4.0.0 in project file
Updated versioning information in `DigitalData.Core.Abstractions.csproj` from 3.6.0 to 4.0.0, including changes to `<Version>`, `<AssemblyVersion>`, and `<FileVersion>`.
2025-05-20 10:36:20 +02:00
Developer 02
f7e2bb2434 Refactor repository pattern and mark methods obsolete
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.
2025-05-20 10:35:27 +02:00
Developer 02
5995b334eb Mark ICRUDRepository as obsolete
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.
2025-05-20 10:20:42 +02:00
Developer 02
1b8dc29595 Enhance IRepository<TEntity> with new method overloads
- Added overload for CreateAsync to accept IEnumerable<TEntity>.
- Updated Read method to accept multiple expressions for flexible querying.
2025-05-20 10:11:39 +02:00
Developer 02
36c2c20eab Add CancellationToken support to IReadQuery methods
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.
2025-05-20 10:10:16 +02:00
Developer 02
a7df79629d Refactor cancellation token parameter names
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.
2025-05-20 10:07:42 +02:00
Developer 02
89a77019dc Enhance IRepository and add RepositoryExtensions
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.
2025-05-20 10:05:57 +02:00
Developer 02
21c895c22b Enhance IRepository with async methods and deprecations
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.
2025-05-20 10:00:18 +02:00
Developer 02
4afeddb7f9 Enhance documentation and introduce IReadQuery interface
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.
2025-05-20 09:56:54 +02:00
Developer 02
14d00653d1 Update version to 1.0.1 and remove package references
Updated the versioning information in `DigitalData.Core.Exceptions.csproj` from `1.0.0` to `1.0.1` for `Version`, `AssemblyVersion`, and `FileVersion`. Removed package references for `Microsoft.AspNetCore.Http.Abstractions` version `2.3.0` and `Microsoft.Extensions.Logging.Abstractions` version `9.0.5`.
2025-05-19 17:14:14 +02:00
Developer 02
87e4c1414e Enhance ConfigureGlobalExceptionHandler method
Updated the `ConfigureGlobalExceptionHandler` method in the `DependencyInjection` class to include two optional parameters: `options` (nullable) and `addDefaultHandlers` (defaulting to true). The method now initializes `options` to a default action if null and adds default exception handlers when `addDefaultHandlers` is true, improving flexibility and usability.
2025-05-19 16:45:40 +02:00
Developer 02
fd8e976e1e Refactor HttpExceptionHandler to use properties
Changed DefaultBadRequest, DefaultNotFound, and Default
from readonly fields to properties for lazy evaluation,
enhancing performance and flexibility while maintaining
the same functionality.
2025-05-19 16:18:05 +02:00
Developer 02
2c393701e4 Add NuGet package metadata and asset inclusion
Updated `DigitalData.Core.Exceptions.Middleware.csproj` to include essential NuGet package metadata such as `PackageId`, `Authors`, `Description`, and versioning information. Added an `ItemGroup` for the `core_icon.png` asset to ensure it is packed with the NuGet package. Retained existing framework-specific references for `Microsoft.Extensions.Options` for `net7.0` and `net8.0`.
2025-05-19 16:09:45 +02:00
Developer 02
1d50fd8e5b Update NuGet metadata and project build configurations
Enhanced `DigitalData.Core.Exceptions.csproj` with NuGet package metadata including `PackageId`, `Authors`, `Description`, and versioning details. Added `core_icon.png` asset to the package.

Modified `DigitalData.Core.sln` to change project build configurations from `Debug` to `Release` for multiple projects.
2025-05-19 15:58:27 +02:00
Developer 02
701c34a251 Add assets project and update legacy icon
This commit introduces a new project named "assets" to the solution, which includes two assets: "core_icon.png" and "core_legacy_icon.png". Additionally, the file `core_legacy_icon.png` has been completely replaced with a new version, featuring a different binary structure and likely a new visual design.
2025-05-19 15:34:17 +02:00
Developer 02
63f914d188 Refactor CRUDRepository for improved flexibility
- Added using directives for new application interfaces.
- Removed constraint for IUnique<TId> from TEntity.
- Updated CountAsync method to use GetId() for identifier retrieval.
2025-05-19 15:27:08 +02:00
Developer 02
9ea2599553 Remove DependencyInjection class and global exception handler
The entire `DependencyInjection` class has been removed, including the `UseGlobalExceptionHandler` extension method and its associated `using` directive. This change eliminates the functionality for setting up global exception handling middleware in the application.
2025-05-19 15:25:59 +02:00
Developer 02
b8995da5ea Refactor global exception handling middleware
Updated `GlobalExceptionHandlerMiddleware.cs` to include
necessary using directives for logging and options handling.
Removed the `HandleExceptionAsync` method and replaced it
with a more extensible approach using a dictionary of
handlers for different exception types. Added logging for
unhandled exceptions to ensure proper error tracking.
2025-05-19 15:21:11 +02:00
Developer 02
14013bc7b7 Add default handlers to HttpExceptionHandler
Introduce static methods for creating HttpExceptionHandler instances for specific exceptions. Define default message factory and handlers for common HTTP status codes, including a generic handler that returns a JSON response for internal server errors.
2025-05-19 15:06:24 +02:00
Developer 02
f586e9eb2f Refactor exception handling to use HttpExceptionHandler
Updated GlobalExceptionHandlerOptions to replace HttpExceptionMapping with HttpExceptionHandler. Removed HttpExceptionMapping class and introduced HttpExceptionHandler for managing exceptions in HTTP requests. Added methods for creating specific exception handlers and default handlers for common exceptions, with JSON serialization for error messages.
2025-05-19 15:01:50 +02:00
Developer 02
ce786a6d42 Update package references in project file
Updated `DigitalData.Core.Exceptions.Middleware.csproj` to include specific `Microsoft.Extensions.Options` package references for target frameworks net7.0, net8.0, and net9.0. Removed the previous single `<ItemGroup>` and added three new `<ItemGroup>` entries with the corresponding package versions.
2025-05-19 14:41:46 +02:00
Developer 02
97695fb0b0 Add dependency injection for global exception handler
Introduce methods in DependencyInjection.cs for configuring
and using a global exception handler. Update the project file
to include a reference to Microsoft.Extensions.Options.
Modify GlobalExceptionHandlerMiddleware to accept
IOptions<GlobalExceptionHandlerOptions> for enhanced
configuration through dependency injection.
2025-05-19 14:38:49 +02:00
Developer 02
cb7b69a0a2 Refactor GlobalExceptionHandlerOptions for better access
Updated the accessibility of the RegisteredMappings field to internal and introduced a DefaultMapping property. Modified the Add method to support setting a mapping as default, with adjusted logic for adding mappings.
2025-05-19 14:30:50 +02:00
Developer 02
b38422256c Enhance HttpExceptionMapping with logging and defaults
Added optional 'Log' property to HttpExceptionMapping for
specifying logging behavior. Introduced static readonly
properties for default mappings of BadRequestException and
NotFoundException using a default message factory.
2025-05-19 14:24:10 +02:00
Developer 02
9b29a49ad6 Refactor exception handling with new mapping system
Updated `GlobalExceptionHandlerOptions` to use a new `_registeredMappings` dictionary for `HttpExceptionMapping` objects, enhancing flexibility in mapping exceptions to HTTP responses. Renamed `RegisterException` to `Add` to reflect its new functionality. Removed the `HttpResponse` record definition and introduced a new `HttpExceptionMapping` record, which includes a static `Create` method for easier instantiation of mappings.
2025-05-19 14:15:38 +02:00
Developer 02
83ba492b37 Add global exception handling middleware
Introduces `GlobalExceptionHandlerMiddleware` for managing exceptions in the request pipeline, logging them, and returning JSON error responses. A new project, `DigitalData.Core.Exceptions.Middleware`, is created to house this middleware and related classes. The `GlobalExceptionHandlerOptions` class allows for custom exception registration with specific HTTP status codes, while a new `HttpResponse` record encapsulates status codes and messages for structured responses. The middleware is registered in the `DependencyInjection` class for easy integration.
2025-05-19 13:27:37 +02:00
Developer 02
50c19fea31 Refactor exception handling middleware
Updated DependencyInjection to use GlobalExceptionHandler.
Removed ExceptionHandlingMiddleware and added
GlobalExceptionHandlerMiddleware for unified exception
handling across the application.
2025-05-16 15:59:38 +02:00
Developer 02
f93b197d45 Refactor ExceptionHandlingMiddleware and update dependencies
Rewrote the `ExceptionHandlingMiddleware` class to improve structure and functionality, changing its namespace to `DigitalData.Core.Exceptions`. Updated the constructor to support a nullable logger and implemented null-conditional logging for unhandled exceptions. Added new package references in `DigitalData.Core.Exceptions.csproj` for `Microsoft.AspNetCore.Http.Abstractions` and `Microsoft.Extensions.Logging.Abstractions`. Introduced a new `DependencyInjection` class to register the middleware in the application's pipeline.
2025-05-16 15:55:27 +02:00
Developer 02
eae0d9f913 Refactor DIExtensions and add exception handling middleware
- Improved documentation in DIExtensions.cs for clarity.
- Added project reference to DigitalData.Core.Exceptions.
- Updated solution file to include DigitalData.Core.Exceptions.
- Introduced ExceptionHandlingMiddleware for global exception handling.
- Added BadRequestException and NotFoundException classes.
- Created DigitalData.Core.Exceptions project with .NET 7.0, 8.0, and 9.0 support.
2025-05-16 15:37:21 +02:00
Developer 02
55eb250d7e Deprecate controllers/services; simplify generics
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.
2025-05-16 14:54:31 +02:00
Developer 02
e0c1b856ad Remove ServiceResultExtensions class and Try method
The `ServiceResultExtensions` class has been removed from the
`DigitalData.Core.Abstractions` namespace. This class included a
static method `Try<T>` for handling nullable results, which has
now been eliminated. This change may indicate a refactoring
or a new approach to managing nullable results in the codebase.
2025-05-16 13:12:02 +02:00
Developer 02
3a1aeb7ac3 Refactor namespaces and enhance application structure
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.
2025-05-16 11:24:58 +02:00
Developer 02
246184165f feat(Core.Abstractions): Upgrade auf 3.6 2025-04-28 16:11:26 +02:00
Developer 02
9d36ced82f feat: Hinzufügen von Erweiterungsmethoden zum Abrufen von Konfigurationsoptionen von IServiceProvider
- Implementiert GetOptions<TOptions> zum Abrufen von Optionen oder null.
- Implementiert GetRequiredOptions<TOptions> für den Abruf von Optionen oder das Auslösen einer Ausnahme.
2025-04-28 16:10:31 +02:00
Developer 02
c81ff2c628 feat(ConfigurationExtension): Hinzufügen der Klasse ConfigurationExtension mit der Methode GetOrDefault zum sichereren Abrufen von Konfigurationen
- Einführung einer neuen statischen Klasse ConfigurationExtension im Namespace DigitalData.Core.Abstractions.
- Hinzufügen der GetOrDefault-Erweiterungsmethode zu IConfiguration, die eine einfachere Abfrage von Konfigurationswerten mit Standardverhalten ermöglicht, wenn diese nicht gefunden werden.
- Aktualisierung der Versionsnummern auf 3.5.0 in den Projektdateien.
2025-04-28 15:44:01 +02:00
Developer 02
653665bb25 refactor(LazyServiceProvider.cs): rename DeferredServiceProvider.cs 2025-04-28 14:58:30 +02:00
Developer 02
17edf605e7 chore(Abstractions): Aktualisiert auf 3.4.4 2025-04-28 14:57:29 +02:00
Developer 02
b41373339e feat(core): DeferredServiceProvider für verzögerte IServiceProvider-Initialisierung hinzugefügt 2025-04-28 14:56:25 +02:00
Developer 02
fb9449d701 chore: upradge versions 2025-04-22 23:05:04 +02:00
Developer 02
72f735272f feat(Repository): Add and implement ReadOrDefaultAsync method.
- add read method can map for each
2025-04-22 23:04:11 +02:00
Developer 02
304f5b7b4c chore: unnötiges Projektverzeichnis entfernt 2025-04-22 20:47:47 +02:00
Developer 02
0238310290 chore(Abstractions.Security): Hochgestuft auf 1.0.1 2025-04-22 20:46:09 +02:00
Developer 02
3ac0501231 chore: covert from debug to release to publish package 2025-04-22 18:11:34 +02:00
Developer 02
db8a560805 chore(Infrastructure.AutoMapper): Konfiguration für das Packen 2025-04-22 18:07:40 +02:00
Developer 02
e67361bfe1 chore(DigitalData.Core.Infrastructure): Hochgestuft auf 2.0.2 2025-04-22 18:00:29 +02:00
Developer 02
91594e80bf refactor(EntityConfigurationOptions): aktualisiert, um IServiceCollection mit Callback zu konfigurieren 2025-04-22 17:58:49 +02:00
Developer 02
8d98159ba8 fix: Korrektur der Update- und Löschlogik in DbRepository zur Vermeidung von Laufzeitproblemen 2025-04-22 17:33:55 +02:00
Developer 02
f1f5b9e16d refactor(DbRepositoryTests): Update AddDbRepository configuration 2025-04-22 16:32:17 +02:00