Updated `DigitalData.Core.Application.Abstraction.csproj` to include new properties in the `<PropertyGroup>`, such as package generation, description, package ID, authors, company, product name, copyright, package icon, repository URL, tags, and versioning information. This improves project metadata and compliance with package management standards.
Updated the `Microsoft.EntityFrameworkCore` package version
from `9.0.4` to `9.0.5` for the target framework `net9.0`
in the `DigitalData.Core.Infrastructure.csproj` file.
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.
- Added support for net8.0 and net9.0 frameworks.
- Incremented package, assembly, and file versions to 2.1.0.
- Updated `Microsoft.Extensions.Options` to 7.0.1 for net7.0, 8.0.2 for net8.0, and 9.0.5 for net9.0.
- Updated `Microsoft.Extensions.Options.ConfigurationExtensions` to 8.0.0 for net8.0 and 9.0.5 for net9.0.
- Maintained existing project reference to `DigitalData.Core.Abstractions.csproj`.
- Added net9.0 to target frameworks.
- Updated package description to reference DigitalData.Core.Application.
- Incremented version to 2.1.0 for package, assembly, and file versions.
- Changed package icon path to `..\Assets\core_icon.png`.
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.
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.
Updated versioning information in `DigitalData.Core.Abstractions.csproj` from 3.6.0 to 4.0.0, including changes to `<Version>`, `<AssemblyVersion>`, and `<FileVersion>`.
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.
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`.
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.
Changed DefaultBadRequest, DefaultNotFound, and Default
from readonly fields to properties for lazy evaluation,
enhancing performance and flexibility while maintaining
the same functionality.
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`.
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.
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.
- Added using directives for new application interfaces.
- Removed constraint for IUnique<TId> from TEntity.
- Updated CountAsync method to use GetId() for identifier retrieval.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.