Koto.Infrastructure.EFCore
0.1.0-preview.5
This is a prerelease version of Koto.Infrastructure.EFCore.
dotnet add package Koto.Infrastructure.EFCore --version 0.1.0-preview.5
NuGet\Install-Package Koto.Infrastructure.EFCore -Version 0.1.0-preview.5
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="Koto.Infrastructure.EFCore" Version="0.1.0-preview.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Koto.Infrastructure.EFCore" Version="0.1.0-preview.5" />
<PackageReference Include="Koto.Infrastructure.EFCore" />
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 Koto.Infrastructure.EFCore --version 0.1.0-preview.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Koto.Infrastructure.EFCore, 0.1.0-preview.5"
#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 Koto.Infrastructure.EFCore@0.1.0-preview.5
#: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=Koto.Infrastructure.EFCore&version=0.1.0-preview.5&prerelease
#tool nuget:?package=Koto.Infrastructure.EFCore&version=0.1.0-preview.5&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Koto.Infrastructure.EFCore
EF Core 10 integration for the Koto DDD suite: generic repository, strongly-typed ID converters, specification pattern, and Wolverine outbox wiring.
Install
dotnet add package Koto.Infrastructure.EFCore
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL # or your preferred provider
What's included
| Type | Purpose |
|---|---|
KotoDbContext |
Abstract DbContext; auto-applies StronglyTypedIdConvention; clears domain events after save |
Repository<TAgg, TId> |
Generic IRepository implementation backed by EF Core |
StronglyTypedIdValueConverter<TId, TRaw> |
EF Core ValueConverter for StronglyTypedId<T> properties |
StronglyTypedIdConvention |
Auto-applies converters to all strongly-typed ID properties |
ISpecification<T> / Specification<T> |
Encapsulates query criteria, includes, and ordering |
SpecificationEvaluator |
Applies a specification to an IQueryable<T> |
AddKotoEFCore<TContext>() |
Registers the DbContext via Wolverine's EF Core integration |
Usage
1 — Define your DbContext
public class AppDbContext : KotoDbContext
{
public AppDbContext(DbContextOptions options) : base(options) { }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ApplyConfigurationsFromAssembly(typeof(AppDbContext).Assembly);
}
}
StronglyTypedIdConvention is applied automatically — no manual HasConversion calls needed.
2 — Register
// Program.cs
builder.Services.AddKotoEFCore<AppDbContext>(opts =>
opts.UseNpgsql(builder.Configuration.GetConnectionString("Db")));
// Wolverine setup — enable automatic domain event dispatch via outbox
builder.Host.UseWolverine(opts =>
{
opts.UseEntityFrameworkCoreTransactions();
opts.PublishDomainEventsFromEntityFrameworkCore<IHasDomainEvents, IDomainEvent>(
e => e.DomainEvents);
});
3 — Use a repository
public class OrderRepository : Repository<Order, OrderId>
{
public OrderRepository(AppDbContext ctx) : base(ctx) { }
}
Or rely on the registered IRepository<Order, OrderId> directly.
4 — Specifications
public class ActiveOrdersSpec : Specification<Order>
{
public ActiveOrdersSpec(CustomerId customerId)
{
AddCriteria(o => o.CustomerId == customerId && !o.IsCancelled);
AddInclude(o => o.Items);
ApplyOrderBy(o => o.PlacedAt);
}
}
// In a repository or query handler:
var query = SpecificationEvaluator.GetQuery(_context.Set<Order>(), new ActiveOrdersSpec(customerId));
var orders = await query.ToListAsync(ct);
| Product | Versions 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.
-
net10.0
- Koto.Application (>= 0.1.0-preview.5)
- Koto.Domain (>= 0.1.0-preview.5)
- Microsoft.EntityFrameworkCore (>= 10.0.2)
- WolverineFx (>= 5.39.0)
- WolverineFx.EntityFrameworkCore (>= 5.39.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 |
|---|---|---|
| 0.1.0-preview.5 | 0 | 5/13/2026 |
| 0.1.0-preview.4 | 0 | 5/13/2026 |
| 0.1.0-preview.3 | 19 | 5/13/2026 |