SourceFlow.Stores.EntityFramework
1.0.0
dotnet add package SourceFlow.Stores.EntityFramework --version 1.0.0
NuGet\Install-Package SourceFlow.Stores.EntityFramework -Version 1.0.0
<PackageReference Include="SourceFlow.Stores.EntityFramework" Version="1.0.0" />
<PackageVersion Include="SourceFlow.Stores.EntityFramework" Version="1.0.0" />
<PackageReference Include="SourceFlow.Stores.EntityFramework" />
paket add SourceFlow.Stores.EntityFramework --version 1.0.0
#r "nuget: SourceFlow.Stores.EntityFramework, 1.0.0"
#:package SourceFlow.Stores.EntityFramework@1.0.0
#addin nuget:?package=SourceFlow.Stores.EntityFramework&version=1.0.0
#tool nuget:?package=SourceFlow.Stores.EntityFramework&version=1.0.0
SourceFlow.Stores.EntityFramework
Entity Framework Core persistence provider for SourceFlow.Net with support for SQL Server and configurable connection strings per store type.
Features
- Complete Store Implementations: ICommandStore, IEntityStore, and IViewModelStore
- Flexible Configuration: Separate or shared connection strings per store type
- SQL Server Support: Built-in SQL Server database provider
- Resilience Policies: Polly-based retry and circuit breaker patterns
- Observability: OpenTelemetry instrumentation for database operations
- Multi-Framework Support: .NET 8.0, .NET 9.0, .NET 10.0
Installation
# Install the core package
dotnet add package SourceFlow.Net
# Install the Entity Framework provider
dotnet add package SourceFlow.Stores.EntityFramework
Quick Start
1. Configure Connection Strings
Add connection strings to your appsettings.json:
{
"ConnectionStrings": {
"CommandStore": "Server=localhost;Database=SourceFlowCommands;Trusted_Connection=True;",
"EntityStore": "Server=localhost;Database=SourceFlowEntities;Trusted_Connection=True;",
"ViewModelStore": "Server=localhost;Database=SourceFlowViews;Trusted_Connection=True;"
}
}
Or use a single shared connection string:
{
"ConnectionStrings": {
"DefaultConnection": "Server=localhost;Database=SourceFlow;Trusted_Connection=True;"
}
}
2. Register Services
services.AddSourceFlowStores(configuration, options =>
{
// Use separate databases for each store
options.UseCommandStore("CommandStore");
options.UseEntityStore("EntityStore");
options.UseViewModelStore("ViewModelStore");
// Or use a single shared database
// options.UseSharedConnectionString("DefaultConnection");
});
3. Apply Migrations
The provider automatically creates the necessary database schema when you run your application. For production scenarios, generate and apply migrations:
dotnet ef migrations add InitialCreate --context CommandStoreContext
dotnet ef database update --context CommandStoreContext
Configuration Options
Separate Databases
Configure different databases for commands, entities, and view models:
services.AddSourceFlowStores(configuration, options =>
{
options.UseCommandStore("CommandStoreConnection");
options.UseEntityStore("EntityStoreConnection");
options.UseViewModelStore("ViewModelStoreConnection");
});
Shared Database
Use a single database for all stores:
services.AddSourceFlowStores(configuration, options =>
{
options.UseSharedConnectionString("DefaultConnection");
});
Custom DbContext Options
Apply additional EF Core configuration:
services.AddSourceFlowStores(configuration, options =>
{
options.UseCommandStore("CommandStore", dbOptions =>
{
dbOptions.EnableSensitiveDataLogging();
dbOptions.EnableDetailedErrors();
});
});
Resilience
The provider includes built-in Polly resilience policies for:
- Transient error retry with exponential backoff
- Circuit breaker for database failures
- Automatic reconnection handling
Documentation
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
License
This project is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.EntityFrameworkCore (>= 9.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 9.0.0)
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- OpenTelemetry (>= 1.14.0)
- OpenTelemetry.Api (>= 1.14.0)
- OpenTelemetry.Exporter.Console (>= 1.14.0)
- OpenTelemetry.Extensions.Hosting (>= 1.14.0)
- OpenTelemetry.Instrumentation.EntityFrameworkCore (>= 1.0.0-beta.12)
- Polly (>= 8.4.2)
- SourceFlow.Net (>= 1.0.0)
-
net8.0
- Microsoft.EntityFrameworkCore (>= 9.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 9.0.0)
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- OpenTelemetry (>= 1.14.0)
- OpenTelemetry.Api (>= 1.14.0)
- OpenTelemetry.Exporter.Console (>= 1.14.0)
- OpenTelemetry.Extensions.Hosting (>= 1.14.0)
- OpenTelemetry.Instrumentation.EntityFrameworkCore (>= 1.0.0-beta.12)
- Polly (>= 8.4.2)
- SourceFlow.Net (>= 1.0.0)
-
net9.0
- Microsoft.EntityFrameworkCore (>= 9.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 9.0.0)
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- OpenTelemetry (>= 1.14.0)
- OpenTelemetry.Api (>= 1.14.0)
- OpenTelemetry.Exporter.Console (>= 1.14.0)
- OpenTelemetry.Extensions.Hosting (>= 1.14.0)
- OpenTelemetry.Instrumentation.EntityFrameworkCore (>= 1.0.0-beta.12)
- Polly (>= 8.4.2)
- SourceFlow.Net (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 102 | 11/29/2025 |
v1.0.0 - Initial stable release! Complete Entity Framework Core 9.0 persistence layer for SourceFlow.Net including CommandStore, EntityStore, and ViewModelStore implementations. Features configurable connection strings per store type, SQL Server database provider, Polly resilience policies, OpenTelemetry instrumentation, and support for .NET 8.0, 9.0, and 10.0. Production-ready with comprehensive test coverage.