WitDatabase is a relational database engine written entirely in C#. It provides a complete Entity Framework Core provider, supports SQL queries, ACID transactions, and runs on any platform without native dependencies.
If you've ever struggled with SQLite's native DLLs breaking your plugin architecture, or wished you could use Entity Framework with LiteDB, or needed a real database in Blazor WebAssembly — this is for you.
What is WitDatabase?
WitDatabase is an embedded database for .NET applications. Think SQLite, but pure managed code.
The key differences from existing options:
| Database | Pure .NET | Relational | EF Core |
|---|---|---|---|
| SQLite | ❌ Native | ✅ | ✅ |
| LiteDB | ✅ | ❌ Document | ⚠️ Limited |
| WitDatabase | ✅ | ✅ | ✅ |
SQLite is excellent but requires platform-specific native binaries. This causes problems in plugin isolation, complicates deployment, and doesn't work in Blazor WebAssembly.
LiteDB is pure .NET but it's a document database. Entity Framework Core expects relational semantics — tables, foreign keys, SQL. The paradigms don't match.
WitDatabase fills the gap: pure managed code with a full relational model and complete EF Core support.
Why I Built It
The short version: I needed an embedded database for a plugin system, and nothing worked.
SQLite's native dependencies don't load correctly in isolated AssemblyLoadContext. I spent days trying different configurations — copying DLLs, setting search paths, embedding the full distribution. Nothing worked reliably across platforms.
LiteDB would have worked technically, but my codebase used Entity Framework Core. Rewriting the data layer for a document model wasn't an option.
I searched for a pure-managed relational database with EF Core support. It didn't exist.
So I built one.
For the full story with technical details, see Why I Built WitDatabase: The Plugin Problem Nobody Solved.
Key Features
Full Entity Framework Core Provider
Not an adapter, not a compatibility layer — a proper EF Core provider. Migrations work. LINQ translation works. Change tracking works. Your existing code works unchanged.
Zero Native Dependencies
100% C# code. No P/Invoke, no platform-specific binaries. This means:
- Plugin isolation works correctly
- Blazor WebAssembly works
- Deployment is just .NET assemblies
- No "DLL not found" errors
SQL Support
Real SQL, not a subset:
- SELECT, INSERT, UPDATE, DELETE
- JOINs (INNER, LEFT, RIGHT, CROSS)
- Subqueries and CTEs
- GROUP BY with aggregates
- Window functions
- Indexes
Multiple Storage Engines
Choose based on your workload:
- B+Tree — balanced read/write performance
- LSM-Tree — optimized for write-heavy scenarios
Built-in Encryption
Data protection without external dependencies:
- AES-GCM — standard authenticated encryption
- ChaCha20-Poly1305 — via BouncyCastle
ACID Transactions
Full transaction support with Write-Ahead Logging (WAL) for durability. Your data is safe.
Cross-Platform
Runs everywhere .NET runs:
- Windows, Linux, macOS
- x64, ARM64
- Blazor WebAssembly (with IndexedDB storage)
Quick Start
Install the NuGet package:
dotnet add package OutWit.Database.EntityFramework
Create your DbContext:
public class AppDbContext : DbContext
{
public DbSet<Customer> Customers => Set<Customer>();
public DbSet<Order> Orders => Set<Order>();
protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseWitDb("Data Source=app.witdb");
}
Use it like any EF Core context:
await using var context = new AppDbContext();
await context.Database.EnsureCreatedAsync();
context.Customers.Add(new Customer { Name = "Alice" });
await context.SaveChangesAsync();
var customers = await context.Customers.ToListAsync();
That's it. If you know EF Core, you know WitDatabase.
Use Cases
Desktop Applications — WPF, MAUI, Avalonia. Single-file deployment with embedded data, optional encryption for sensitive information.
Plugin Architectures — Self-contained plugins with isolated storage. No native dependency headaches.
Integration Testing — Replace slow database containers with instant in-memory databases. Same DbContext, same queries, milliseconds instead of minutes.
Portable Demos — Ship your application with sample data. No "please install SQL Server" — just run.
Blazor WebAssembly — Full database in the browser with IndexedDB persistence. Works offline, data survives refresh.
CI/CD Pipelines — No database containers in your CI config. Tests just run.
What's Included
The release includes:
- WitDatabase.Core — the database engine
- WitDatabase.EntityFramework — EF Core provider
- WitDatabase.Ado — ADO.NET provider for direct SQL
- WitDatabase.Core.IndexedDb — browser storage for Blazor WASM
Plus sample projects demonstrating real-world usage:
- Console application with interactive examples
- REST API with ADO.NET
- REST API with Entity Framework Core
- Blazor WebAssembly with MVVM
- Identity Server with OpenIddict
Documentation covers everything from quick start to advanced scenarios.
What It's Not
Let me be honest about limitations.
Not a production server database. For high-traffic web applications, use PostgreSQL or SQL Server. WitDatabase is for embedded scenarios — desktop apps, plugins, testing, demos.
Not the fastest option. Managed C# code can't match hand-optimized native C. For most embedded use cases, performance is excellent. For bulk operations on millions of rows, SQLite will be faster.
Not a distributed database. Single-file, single-process. No replication, no clustering. That's not the problem it solves.
If you need an embedded database that works in plugin isolation, runs in the browser, and supports EF Core — WitDatabase is the right tool. If you need maximum throughput for a production server — it's not.
Get Started
- GitHub: github.com/dmitrat/WitDatabase
dotnet add package OutWit.Database.EntityFramework
Feedback Welcome
WitDatabase is open source under Apache 2.0 license. Free for commercial and personal use.
If you find a bug, have a feature request, or just want to share how you're using it — open an issue on GitHub. Stars are appreciated if you find the project useful.
Thanks for reading. I hope WitDatabase solves a problem for you like it did for me.