Simple ORM .NET
Zero-reflection ORM for .NET
Introduction
Simple ORM .NET is a zero-reflection ORM with source generation, built-in drivers for PostgreSQL and SQLite, and full Native AOT compatibility.
Designed for simplicity, performance, and modern .NET development, it provides a familiar DbContext and DbSet pattern without the overhead of reflection.
Quick Start
Get started with Simple ORM .NET in just a few steps:
# Install via NuGet
dotnet add package SimpleORMDotNet
using SimpleORMDotNet;
using SimpleORMDotNet.Entities;
// Define your entity
[Entity]
public class Customer
{
[PrimaryKey]
public int Id { get; set; }
[Column("full_name")]
public string Name { get; set; }
public string Email { get; set; }
}
// Create a DbContext
public class AppDbContext : DbContext
{
public StaticSet Customers { get; set; }
protected override void OnConfiguring(DbContextOptions options)
{
options.UsePostgreSQL("Host=localhost;Database=mydb;Username=user;Password=pass");
}
}
// Perform CRUD operations
using var db = new AppDbContext();
var customer = new Customer { Name = "John Doe", Email = "[email protected]" };
db.Customers.Add(customer);
await db.SaveChangesAsync();
Key Features
Zero Reflection at Runtime
All mapping and SQL generation happens at compile-time via Roslyn Source Generators.
Self-Sufficient
Built-in drivers for PostgreSQL and SQLite. No external dependencies required.
Thread-Safe
Integrated connection pooling and thread-safe context management.
AOT Ready
Fully compatible with .NET Native AOT compilation.
Installation
Choose your preferred installation method:
# Package Manager
Install-Package SimpleORMDotNet
# .NET CLI
dotnet add package SimpleORMDotNet
# Package Reference
# Clone the repository
git clone https://github.com/SimpleORMDotNet/SimpleORMDotNet.git
# Build the project
cd SimpleORMDotNet
dotnet build
# Reference the built assembly
Project Navigation
Quick Actions
Project Stats
- Version: v1.0.0
- License: Apache 2.0
- .NET Version: 10.0+
- Last Updated: 2024-11-20
- Stars: 150
- Forks: 8