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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SourceFlow.Stores.EntityFramework" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SourceFlow.Stores.EntityFramework" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SourceFlow.Stores.EntityFramework" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SourceFlow.Stores.EntityFramework --version 1.0.0
                    
#r "nuget: SourceFlow.Stores.EntityFramework, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SourceFlow.Stores.EntityFramework@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SourceFlow.Stores.EntityFramework&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SourceFlow.Stores.EntityFramework&version=1.0.0
                    
Install as a Cake Tool

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

License

This project is licensed under the MIT License.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.