Simple ORM .NET

Zero-reflection ORM for .NET

v1.0.0 Apache 2.0 License .NET 10+ 2K+ downloads

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:

bash

# Install via NuGet
dotnet add package SimpleORMDotNet
                                
C#

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:

bash

# Package Manager
Install-Package SimpleORMDotNet

# .NET CLI
dotnet add package SimpleORMDotNet

# Package Reference

                                                

bash

# Clone the repository
git clone https://github.com/SimpleORMDotNet/SimpleORMDotNet.git

# Build the project
cd SimpleORMDotNet
dotnet build

# Reference the built assembly