Commit Graph

6 Commits

Author SHA1 Message Date
9bae0ab95c Refactor Repository and update project dependencies
Added `SaveChangesAsync` to `IRepository` for async persistence.
Introduced AutoMapper and DbContext dependencies in `Repository`.
Simplified EF Core operations by removing `#if NET48` logic.
Replaced `Task.Run` with direct EF Core calls for .NET Framework.
Updated AutoMapper version for .NET 8 and added EF Core testing.
Suppressed AutoMapper vulnerability warning in project file.
Performed general cleanup and improved maintainability.
2026-07-09 15:58:33 +02:00
574e5ed209 Add in-memory DB support for .NET 4.8 and .NET 8 testing
Introduced a `DbConnection` constructor in `JobRunnerDbContext`
for Entity Framework 6 to enable in-memory testing with the
Effort library. Added conditional compilation to support both
.NET Framework 4.8 and .NET 8.

Implemented `AddInfrastructureInMemory` in `DependencyExtension`
to register services with in-memory databases:
- For .NET 4.8, uses Effort's transient connection.
- For .NET 8, uses EF Core's in-memory provider.

Registered AutoMapper in both methods for object mapping. Added
`EntityMappingProfile` to define AutoMapper configurations,
enforcing explicit DTO-to-entity mappings. These changes improve
testability and maintainability across .NET versions.
2026-07-09 15:45:18 +02:00
65a51482dd Add ECMJobRunner.Tests and enhance DI for multi-frameworks
Added a new `ECMJobRunner.Tests` project to the solution for unit
testing, including build configurations for Debug and Release.

Enhanced the `DependencyExtension` class to support dependency
injection for both .NET Framework 4.8 (EF6) and .NET 8 (EF Core)
using conditional compilation. Registered `JobRunnerDbContext`
differently based on the target framework and added AutoMapper
registration for both frameworks.

Updated `ECMJobRunner.Infrastructure.csproj` to include new
package references for DI and AutoMapper in .NET Framework 4.8.
Improved code structure and readability by removing redundant
directives and aligning DI patterns across frameworks.
2026-07-09 13:48:55 +02:00
7d53b599de Add Infrastructure layer with EF6/EF Core support
Introduced a robust Infrastructure layer for the ECMJobRunner system:
- Added `AGENTS.md` with detailed project documentation.
- Implemented generic repository and unit-of-work patterns.
- Added `CfgProfileRepository`, `ProfileSqlJobRepository`, and `ProfileHistoryRepository`.
- Integrated AutoMapper for DTO-to-entity mapping.
- Added multi-framework support for .NET Framework 4.8 (EF6) and .NET 8.0 (EF Core) using conditional compilation.
- Updated `ECMJobRunner.Infrastructure.csproj` with metadata fixes and dependencies.
- Introduced dependency injection extension for .NET 8.0.
- Enhanced project structure and database context with entity mappings.
2026-07-09 13:35:02 +02:00
ff6faa1e5b Add JobRunnerDbContext with multi-framework support
Introduce `JobRunnerDbContext` to support both EF6 (.NET 4.8)
and EF Core (.NET 8) using conditional compilation. Add `DbSet`
properties for `CfgProfiles`, `ProfileSqlJobs`, and
`ProfileHistories`. Provide constructors for both frameworks
to handle connection strings or options. Ensure compatibility
with multiple runtime environments.
2026-07-09 13:34:03 +02:00
26dc58d82e Add Application and Infrastructure projects to solution
Two new projects, `ECMJobRunner.Application` and
`ECMJobRunner.Infrastructure`, were added to the solution file
(`ECM.JobRunner.sln`). Build configurations for these projects
were also added.

`ECMJobRunner.Application.csproj` targets both .NET Framework 4.8
and .NET 8.0, with properties such as `LangVersion`, `Nullable`,
and `PackageId` defined.

`ECMJobRunner.Infrastructure.csproj` also targets .NET Framework
4.8 and .NET 8.0. It includes conditional dependencies:
- For `net480`, it references `EntityFramework` 6.5.1.
- For `net8.0`, it references `Microsoft.EntityFrameworkCore`
  and related packages (version 8.0.11).
2026-07-09 11:48:10 +02:00