EF Core Setup
Minimal example to enable Entity Framework Core persistence for Elsa Workflows, including database provider setup and migrations.
Prerequisites
NuGet Packages
dotnet add package Elsa
dotnet add package Elsa.EntityFrameworkCore.PostgreSQL
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQLdotnet add package Elsa
dotnet add package Elsa.EntityFrameworkCore.SqlServer
dotnet add package Microsoft.EntityFrameworkCore.SqlServerdotnet add package Elsa
dotnet add package Elsa.EntityFrameworkCore.Sqlite
dotnet add package Microsoft.EntityFrameworkCore.SqliteMinimal Configuration
Program.cs
appsettings.json
Applying Migrations
Option 1: Automatic Migrations (Development)
Option 2: CLI Migrations (Production)
Multiple Contexts
Advanced Configuration
Separate Databases
Connection Pooling
Retry on Transient Failures
Troubleshooting
Migration Errors
Logging
Related Documentation
Last updated