Relational table metadata, existence, connection and one-shot schema helpers for .NET developers writing infrastructure code.
Use a .NET 10 console project. Install the package, then replace Program.cs with the example.
dotnet new console -f net10.0 -n EfCoreDemo
cd EfCoreDemo
dotnet add package DKNet.EfCore.Relational.Helpers
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --version 10.0.3
using DKNet.EfCore.Relational.Helpers;
using Microsoft.EntityFrameworkCore;
var options = new DbContextOptionsBuilder<DemoDb>()
.UseNpgsql("Host=localhost;Database=unused;Username=unused;Password=unused").Options;
using var db = new DemoDb(options);
Console.WriteLine(db.GetTableName<Item>()); // (, Items)
public sealed class DemoDb(DbContextOptions<DemoDb> options) : DbContext(options)
{
public DbSet<Item> Items => Set<Item>();
}
public sealed class Item { public int Id { get; set; } }
Run with dotnet run. This metadata-only example does not connect to the placeholder endpoint.
These static extension methods run in the caller process with the existing DbContext. Provider services execute catalog queries and schema creation; there is no helper-specific service or cache. The project references Extensions and EF Core Relational.
The Quick Start only reads metadata, so its placeholder connection is never opened. Unmapped types return (null, null); SQL Server alone supplies dbo when the model supplies no schema. Catalog and DDL operations are separate feature pages.
INFORMATION_SCHEMA.TABLES using the entity mapped table and, when known, schema.CreateTableAsync<TEntity> only for one-shot provisioning against an empty relational schema.