Skip to content

Enhancement: Elsa 2 - EFCore persistence, better support for net10 (excludes MySql - Pomelo)#7716

Open
terry-delph wants to merge 4 commits into
elsa-workflows:2.xfrom
mintra-as:enhancement/elsa-2-efcore-persistence-better-support-net10
Open

Enhancement: Elsa 2 - EFCore persistence, better support for net10 (excludes MySql - Pomelo)#7716
terry-delph wants to merge 4 commits into
elsa-workflows:2.xfrom
mintra-as:enhancement/elsa-2-efcore-persistence-better-support-net10

Conversation

@terry-delph

@terry-delph terry-delph commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Purpose

Add .NET 10 multi-targeting support to Entity Framework Core projects while maintaining compatibility with providers that do not yet support EF Core 10.


Scope

Select one primary concern:

  • Bug fix (behavior change)
  • Refactor (no behavior change)
  • Documentation update
  • Formatting / code cleanup
  • Dependency / build update
  • New feature

Description

Problem

Entity Framework Core projects needed .NET 10 support for testing and compatibility. However, Pomelo.EntityFrameworkCore.MySql does not yet support EF Core 10.x, which blocks full .NET 10 adoption across all database providers.

Solution

Introduce .NET 10 multi-targeting for EF Core projects while applying conditional support for providers.

Entity Framework Core .NET 10 Support

Core Projects

  • Add net10.0 to TargetFrameworks in Elsa.Persistence.EntityFramework.Core.csproj
    • Now targets: netstandard2.1;net8.0;net9.0;net10.0
  • Add conditional ItemGroup for .NET 10:
    • Microsoft.EntityFrameworkCore 10.0.8
    • Microsoft.EntityFrameworkCore.Relational 10.0.8
  • Enables SQL Server, PostgreSQL, and SQLite providers to fully support .NET 10

MySQL Provider Limitation

  • Restrict MySQL provider to .NET 8 and .NET 9:
    • Update Elsa.Persistence.EntityFramework.MySql.csproj
    • Remove .NET 10 target and related dependencies

Root Cause

Microsoft.EntityFrameworkCore.Relational >= 9.0.0 && <= 9.0.999

Impact

  • MySql provider cannot be used in a .net10 project as it would try to pull in EFCore 10 which is not compatible
  • NuGet resolves the net9.0 build automatically
  • Potential version conflicts when mixing providers requiring EF Core 10

Workaround

  • Prefer SQL Server, PostgreSQL, or SQLite providers for .NET 10

Future

  • Add .NET 10 support once Pomelo releases a compatible version

Sample Projects - Multi-Targeting for Testing

  • Update ElsaDashboard.Samples.AspNetCore.Monolith.csproj

  • Update Elsa.Samples.Persistence.EntityFramework.csproj

  • Add:

    net10.0
    
  • Enables:

    • Cross-framework validation
    • EF Core migration testing
    • Provider compatibility verification

Connection Updates

Update SQL Server connection as they were not matching docker:

"Server=localhost,1433;Database=Elsa;User Id=SA;Password=:8jNZdK7cK;TrustServerCertificate=True"

Disable MySQL in .NET 10 samples:

// ef.UseMySql(...); // Currently not supported until Pomelo supports net10

Docker Infrastructure Updates

docker-compose.yaml

  • Replace mysql-arm with mysql:8
  • Ensures broader platform compatibility
  • Removed MySql 5 container as it conflicted with ports for MySql 8

Azurite Update

  • Use: mcr.microsoft.com/azure-storage/azurite
  • Expose ports:
    • 10000 (Blob)
    • 10001 (Queue)
    • 10002 (Table)

Dependency Version Summary

Package .NET 8 .NET 9 .NET 10
Microsoft.EntityFrameworkCore 8.0.1 9.0.1 10.0.8
Microsoft.EntityFrameworkCore.Relational 8.0.1 9.0.1 10.0.8
Pomelo.EntityFrameworkCore.MySql 8.0.3 9.0.0 ❌ Not Supported
Npgsql.EntityFrameworkCore.PostgreSQL 8.0.0 9.0.2 10.0.0
Oracle.EntityFrameworkCore 8.21.121 9.23.60 10.23.26000
Microsoft.EntityFrameworkCore.Sqlite 8.0.1 9.0.1 10.0.0
Microsoft.EntityFrameworkCore.SqlServer 8.0.1 9.0.1 10.0.0

Breaking Changes

  • None for existing .NET 8/9 consumers
  • MySQL limitation:
    • Any users that use Elsa.Persistence.EntityFramework.MySql provider cannot upgrade to .Net10 as it will fail to build
    • Microsoft.EntityFrameworkCore.Relational >= 9.0.0 && <= 9.0.999

Notes

  • Architecture allows providers to differ in framework support
  • MySQL support will be revisited when Pomelo releases an update for EFCore 10

Verification

Steps:

  1. Build and run the following projects targeting net9.0, and net10.0
  • Run ElsaDashboard.Samples.AspNetCore.Monolith.csproj
  • Run Elsa.Samples.Persistence.EntityFramework.csproj
  1. Run EF Core migrations across providers
  2. Run sample projects using Docker services

Expected outcome:

  • ✅ All frameworks compile successfully
  • ✅ EF Core migrations execute correctly
  • ✅ SQL Server, PostgreSQL, SQLite work on .NET 10
  • ✅ MySQL works on .NET 8/9
  • ✅ Sample projects run across all configurations

Screenshots / Recordings (if applicable)

N/A


Checklist

  • The PR is focused on a single concern
  • Commit messages follow the recommended convention
  • Tests added or updated (if applicable)
  • Documentation updated (if applicable)
  • No unrelated cleanup included
  • All tests pass
    ``

Upgraded `System.Text.Encodings.Web` to `10.0.8` and other key dependencies (`Newtonsoft.Json`, `Microsoft.Extensions.Hosting`, etc.) across multiple projects for compatibility, security, and performance improvements.

Upgraded `Jint`:

- Updated `Jint` to `4.9.2` from beta version
- Enhanced `ByteArrayConverter` to handle byte arrays as `ArrayBuffer` in JavaScript
- Added new tests for validation

Upgrade Rebus dependencies across core projects:

- Upgraded Rebus to version 8.9.2 in Elsa.Abstractions.csproj.
- Upgraded Rebus.ServiceProvider to version 10.7.2 in Elsa.Core.csproj.
- Upgraded Rebus.Microsoft.Extensions.Logging to version 5.2.0 in Elsa.Core.csproj.

These upgrades ensure compatibility with the latest features, bug fixes, and improved integration with .NET 8/9/10 targets.

Duplicate Swashbuckle packages references:

- Removed duplicate Swashbuckle (Swagger) package references from Elsa.Server.Api.csproj for consistent multi-targeting.
- Ensured only one version per framework is referenced.
…NET 8/9/10) (Issue: elsa-workflows#7429)

- Conditionally upgrade Swashbuckle.AspNetCore.SwaggerGen to 10.2.1 for .NET 10
  (keep 6.3.0 for .NET 8/9 for compatibility)
- Add conditional compilation for swaggerDoc.Tags initialization
  - Use HashSet<OpenApiTag> for .NET 10+
  - Use List<OpenApiTag> for .NET 8/9
- Add conditional compilation for operation.Tags
  - Use OpenApiTagReference for .NET 10+
  - Use OpenApiTag for .NET 8/9
- Fix RequestBody.Content null reference by explicit initialization
- Improve JsonSchema validation to check for null or whitespace
- tailwind.css seems to have not been updated in a previous commit, the rebuild has identified some changes

Resolves ReflectionTypeLoadException: "Method 'Apply' in type
'HttpEndpointDocumentFilter' does not have an implementation"
caused by OpenAPI model breaking changes in .NET 10.
…flows#7502)

- Added `[Tags("Secrets")]` to group secrets api endpoints in Swagger UI.
- Introduced `RemoveEmptyControllerTagsFilter` to remove unused
tags from OpenAPI documents.
- Registered the filter in Swagger configuration with .NET 10 compatibility adjustments.
…tions)

- Add net10.0 target to Elsa.Persistence.EntityFramework.Core with EF Core 10.0.8
- Restrict MySQL provider to net8.0/net9.0 (Pomelo blocks EF Core 10.x)
- Multi-target sample projects for testing (ElsaDashboard.Samples, EF samples)
- Update docker-compose: mysql:8 image, Azurite with all service ports
- Update sample connection strings to match docker-compose
@terry-delph terry-delph marked this pull request as ready for review June 10, 2026 09:22
@greptile-apps

greptile-apps Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@terry-delph

Copy link
Copy Markdown
Contributor Author

This PR is based off #7518 but will be rebased onto 2.x upon the other branch merging depending on how it is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant