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.
Updated the `LuckyPennySoftwareLicenseKey` property in the
`ConfigurationOptions` class to allow null values by changing
it from a non-nullable string with a default value of an empty
string to a nullable string (`string?`). This change enables
explicit representation of the absence of a license key using
`null` instead of an empty string.
Introduced a new `DependencyInjection` class in the `ReC.Application` namespace to streamline service registration.
- Added `AddRecServices` extension method for `IServiceCollection` to configure AutoMapper and MediatR with assembly scanning.
- Included `ConfigurationOptions` class to allow configuration of a `LuckyPennySoftwareLicenseKey`.
- Added `using` directives for `Microsoft.Extensions.DependencyInjection` and `System.Reflection` to support dependency injection and assembly scanning.
Added `AutoMapper` and `MediatR` NuGet packages to the
`ReC.Application.csproj` file to include these libraries as
dependencies.
Created a `DtoMappingProfile` class in the `ReC.Application.Dto`
namespace to define a mapping configuration between the `RecAction`
entity and the `RecActionDto` data transfer object using `AutoMapper`.
Included necessary `using` directives for `AutoMapper` and
`ReC.Domain.Entities` in the `DtoMappingProfile.cs` file to enable
the mapping functionality.
These changes improve maintainability by automating object-to-object
mapping and prepare the project for potential use of the mediator
pattern with `MediatR`.
Added the `MediatR` NuGet package (v13.1.0) to enable the mediator pattern. Updated `ReC.Application.csproj` to include a project reference to `ReC.Domain`.
Introduced `RecActionDto` as a Data Transfer Object (DTO) for representing "RecAction" details, including properties for endpoints, authentication, and SQL connections.
Added `ReadRecActionQuery` to handle queries for retrieving `RecActionDto` objects, leveraging MediatR. This query filters results based on `ProfileId`.
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.
Updated AddInfrastructureServices to support a generic
TRecDbContext type parameter, enabling the use of custom
DbContext types. Modified AddDbContext and AddDbRepository
to use the generic TRecDbContext type. Added an overload
of AddInfrastructureServices that defaults to RecDbContext
for backward compatibility. These changes enhance flexibility
and reusability while maintaining compatibility with existing
implementations.
Added `DigitalData.Core.Infrastructure` dependency and updated the `DependencyInjection` class to include `services.AddDbRepository` for dynamic repository registration from the `RecAction` assembly. Updated `ReC.Infrastructure.csproj` to include the new package reference. Improved dependency injection setup for better repository management.
Introduced a `DependencyInjection` class with an extension
method `AddInfrastructureServices` to register `RecDbContext`
using configurable `DbContextOptions`. Added a `ConfigurationOptions`
class to encapsulate `DbContext` configuration.
Validated that `DbContextOptionsAction` is provided before
registration. Updated `ReC.Infrastructure.csproj` to include
`Microsoft.Extensions.Configuration.Abstractions` for enhanced
configuration support. Added necessary `using` directives.
Replaced the `Action` class with a new `RecAction` class to represent the `VWREC_ACTION` database view. The `RecAction` class retains the same properties and annotations as the removed `Action` class, ensuring compatibility with the database schema.
Updated `RecDbContext` to use `RecAction`:
- Replaced `DbSet<Domain.Entities.Action>` with `DbSet<RecAction>`.
- Updated the `OnModelCreating` configuration to use `RecAction`.
This refactor improves clarity, aligns with naming conventions, and prepares the codebase for future changes.
Added the `Microsoft.EntityFrameworkCore` NuGet package to the
`ReC.Infrastructure` project to enable database functionality.
Introduced `RecDbContext` with `DbSet` properties for `EndpointParam`,
`Action`, and `OutRes` entities. Configured `Action` as a keyless
entity in `OnModelCreating`. Added a project reference to
`ReC.Domain` to use domain entities in the infrastructure layer.
The `Trigger` method in the `ActionController` class was renamed to `Invoke`. This change updates the HTTP POST endpoint that accepts a `profileId` as a route parameter. The method's functionality remains unchanged, as it still throws a `NotImplementedException`.
A new `OutRes` class was added to represent the `TBREC_OUT_RESULT` table in the `dbo` schema. The class includes properties for `Id`, `ActionId`, `ResultHeader`, `ResultBody`, `AddedWho`, `AddedWhen`, `ChangedWho`, and `ChangedWhen`, all mapped to corresponding database columns using data annotations. The `System.ComponentModel.DataAnnotations` and `System.ComponentModel.DataAnnotations.Schema` namespaces were imported to support this configuration.
Renamed the class `VwRecAction` to `Action` to simplify the name
and better align with naming conventions. The `[Table]` attribute
mapping to `VWREC_ACTION` in the `dbo` schema remains unchanged.
Class properties such as `ActionId` and `ProfileId` are unaffected
by this change.
Introduced the `EndpointParam` class to represent the `TBREC_CFG_ENDPOINT_PARAMS` table in the database.
- Added `using` directives for data annotations and table mapping.
- Defined properties to map to table columns, all nullable for flexibility.
- Annotated the class with `[Table]` and properties with `[Column]` attributes.
- Marked `Guid` as the primary key using the `[Key]` attribute.
- Documented the class with a summary explaining its purpose and design.
This change facilitates ORM integration and ensures schema flexibility.
Introduced the `VwRecAction` class to represent the `VWREC_ACTION`
database view. The class is annotated with `[Table]` and `[Column]`
attributes for schema mapping and includes nullable properties to
handle potential schema changes gracefully. Added `using` directives
for data annotations and schema mapping. Documented the class to
explain its purpose and design decisions, ensuring flexibility and
resilience against database schema evolution.
Updated `ReC.API.csproj` to include `Swashbuckle.AspNetCore` (v6.6.2) for Swagger/OpenAPI documentation. Removed an unused `<ItemGroup>` referencing the `Controllers\` folder.
Added a new `ActionController` with a `[Route("api/[controller]")]` and `[ApiController]` attributes. Introduced a `Trigger` HTTP POST endpoint that accepts a `profileId` parameter. The method is currently unimplemented and throws a `NotImplementedException`.
A new project, ReC.Client, has been added to the solution file (ReC.sln).
The project supports two target frameworks: net462 and net8.0.
Build configurations for Debug and Release have been added, and the
project has been nested under the same parent as other projects.
The ReC.Client.csproj file uses the Microsoft.NET.Sdk SDK and includes
conditional properties for frameworks other than net462, enabling
implicit global usings and nullable reference types.
A new project, `ReC.Application`, has been added to the solution (`ReC.sln`).
The project file (`ReC.Application.csproj`) targets .NET 8.0, enables implicit
global usings, and enables nullable reference types.
The solution file has been updated to include the new project, its build
configurations, and its nesting under the `src` folder.
A new project, `ReC.Infrastructure`, has been added to the solution.
The project is configured to target `.NET 8.0` and includes modern
features such as implicit global usings and nullable reference types.
It has been integrated into the solution's build configurations
(Debug/Release for Any CPU) and nested under the `src` folder.
A new project, `ReC.Domain`, has been added to the solution.
The project is included in `ReC.sln` with build configurations
for `Debug|Any CPU` and `Release|Any CPU`. It is nested under
the `src` folder in the solution structure.
The `ReC.Domain.csproj` file targets .NET 8.0, uses the
`Microsoft.NET.Sdk` SDK, and enables modern C# features such
as implicit `using` directives and nullable reference types.
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.