DynamicEndpoints.EntityFrameworkCore 0.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DynamicEndpoints.EntityFrameworkCore --version 0.3.0
                    
NuGet\Install-Package DynamicEndpoints.EntityFrameworkCore -Version 0.3.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="DynamicEndpoints.EntityFrameworkCore" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DynamicEndpoints.EntityFrameworkCore" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="DynamicEndpoints.EntityFrameworkCore" />
                    
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 DynamicEndpoints.EntityFrameworkCore --version 0.3.0
                    
#r "nuget: DynamicEndpoints.EntityFrameworkCore, 0.3.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 DynamicEndpoints.EntityFrameworkCore@0.3.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=DynamicEndpoints.EntityFrameworkCore&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=DynamicEndpoints.EntityFrameworkCore&version=0.3.0
                    
Install as a Cake Tool

DynamicEndpoints.EntityFrameworkCore

Entity Framework Core persistence for DynamicEndpoints: runtime-defined HTTP endpoints for ASP.NET Core. With it, endpoint definitions survive restarts and are shared by every instance of your application.

License: MIT

Use your own DbContext

public sealed class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options)
{
    protected override void OnModelCreating(ModelBuilder modelBuilder) =>
        modelBuilder.ApplyDynamicEndpointsConfiguration(); // adds the DynamicEndpoints table
        // or: modelBuilder.ApplyConfiguration(new DynamicEndpointRecordConfiguration("endpoints", "api"));
}

builder.Services.AddDbContext<AppDbContext>(o => o.UseNpgsql(connectionString));
builder.Services.AddDynamicEndpoints().UseEntityFrameworkStore<AppDbContext>();

Create the table with your migrations as usual (dotnet ef migrations add AddDynamicEndpoints). .MigrateOnStartup<AppDbContext>() applies them on start-up if you want that.

…or the bundled context, with its own migrations

builder.Services.AddDynamicEndpoints()
    .UseEntityFrameworkStore(o => o.UseNpgsql(connectionString), migrateOnStartup: true); // DynamicEndpointsDbContext

The migrations have no provider-specific column types, so they work with SQL Server, PostgreSQL, SQLite, MySQL, … A table created earlier with EnsureCreated is adopted into the migration history. If you'd rather migrate in your deployment pipeline, leave migrateOnStartup off and call Database.MigrateAsync() on DynamicEndpointsDbContext there.

Save endpoints together with your own data

var changes = manager.BeginChanges(db.GetDynamicEndpointStore());   // tracked by db, not saved
await changes.UpsertAsync(definition, ct);
db.FeatureVersions.Add(version);
await db.SaveChangesAsync(ct);                                      // one SaveChanges, one transaction
await changes.ApplyAsync(ct);                                       // now the routes change

If you drop the change set instead of saving, nothing is routed. A stale revision fails inside your SaveChanges with DbUpdateConcurrencyException. If you use explicit transactions, manager.BeginChanges(HttpContext.RequestServices) saves through your scoped DbContext, inside db.Database.BeginTransactionAsync().

How it is stored

  • Columns: the searchable fields (method, route, name, enabled, version, timestamps).
  • JSON: the full definition, so the definition model can grow without schema migrations.
  • Concurrency: Version is a concurrency token, so a stale write from another instance or admin is rejected.
  • Providers: any EF Core relational provider works (SQL Server, PostgreSQL, SQLite, MySQL, …).

πŸ“– Documentation Β· πŸ“ Changelog

Product Compatible and additional computed target framework versions.
.NET 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
0.4.0 134 10/2/2026
0.3.0 99 10/2/2026
0.2.0 105 10/1/2026
0.1.2 104 10/1/2026
0.1.1 116 10/1/2026
0.1.0 104 10/1/2026