- Integrated `NLog` for improved logging capabilities.
- Added a logger instance and initialized logging with `NLog`.
- Wrapped app setup in a `try-catch` block to handle startup exceptions.
- Configured logging to use `NLog` in non-development environments.
- Refactored service registration for better organization.
- Retained key configurations for `AddRecServices` and `AddRecInfrastructure`.
- Reorganized middleware pipeline setup for clarity.
- Added exception logging during startup to improve debugging.
Updated `AddRecInfrastructure` to improve DbContext setup:
- Renamed parameters for clarity (`dbContextOpt` to `opt`).
- Renamed `connectionString` to `cnnStr` for consistency.
- Added `LogTo` for SQL query logging at `Trace` level.
- Enabled `EnableSensitiveDataLogging` for debugging.
- Enabled `EnableDetailedErrors` for detailed error messages.
Added advanced logging and debugging capabilities to the
DbContext configuration in `AddRecInfrastructure`:
- Integrated `ILogger<RecDbContext>` for logging.
- Enabled SQL query logging with `LogTo` at `Trace` level.
- Enabled sensitive data logging for debugging purposes.
- Enabled detailed error messages for better diagnostics.
Updated `ConfigureDbContext` to accept `IServiceProvider`, enabling dependency injection during database context setup. Modified `DependencyInjection.cs` to align with this change by updating `DbContextOptionsAction` and its related method signature.
Removed unused `System.IO` and `System.Text.Json` namespaces from `RecActionController.cs` to improve code cleanliness.
Refactor `using` directives in `Program.cs` to include `ReC.API.Middleware` for middleware functionality.
Introduce `ExceptionHandlingMiddleware` to the HTTP request pipeline to handle exceptions globally. Suppress CS0618 warnings for its usage. No changes were made to the existing controller service configuration.
Introduced a new `RecAction` configuration section in `appsettings.json` with a `MaxConcurrentInvocations` property. Updated `Program.cs` to use the `Configuration` object to pass the `RecAction` settings to the `AddRecServices` method. Replaced the `MediatRLicense` value in `appsettings.json` with no functional changes.
Renamed `AddInfrastructureServices` to `AddRecInfrastructure`
in both generic and non-generic forms to standardize naming
and improve clarity. Updated `Program.cs` to use the new
method, adding database context configuration with a
connection string from the app's configuration.
Added a constraint to `AddRecInfrastructure<TRecDbContext>`
requiring `TRecDbContext` to inherit from `RecDbContext`.
Refactored the method to register entities from the assembly
containing `RecAction`. Removed the old
`AddInfrastructureServices` method entirely.
Added `AddRecServices` and `AddInfrastructureServices` to `Program.cs` with necessary configurations. Updated `ReC.API.csproj` to include project references to `ReC.Application` and `ReC.Infrastructure`, and fixed an encoding issue by adding a BOM. Modified `appsettings.json` to include `MediatRLicense` and adjusted `AllowedHosts` format. Ensured `TargetFramework` and other project properties remain unchanged.
Added `Microsoft.EntityFrameworkCore` and `ReC.Infrastructure` namespaces to `Program.cs` to enable EF Core functionality and infrastructure services. Configured the database context with a connection string from the app's configuration and added error handling for missing connection strings.
Updated `ReC.API.csproj` to include the `Microsoft.EntityFrameworkCore.SqlServer` NuGet package (v9.0.11) for SQL Server support. Added a project reference to `ReC.Infrastructure` to enable the API project to use the infrastructure layer.
Initialized the ASP.NET Core application in `Program.cs` with
services for controllers, Swagger/OpenAPI, and middleware
for HTTPS redirection and authorization.
Added `launchSettings.json` to configure application launch
profiles for HTTP, HTTPS, and IIS Express environments.
Updated `ReC.API.csproj` to target .NET 8.0, enable nullable
reference types, and include the `Swashbuckle.AspNetCore`
package for Swagger support.
Added `appsettings.json` and `appsettings.Development.json`
for logging and environment-specific configurations.
Reorganized the solution structure in `ReC.sln` by moving
the `ReC.API` project under a `src` folder and updating
the `NestedProjects` section.