SimpleORMDotNet 1.0.0
dotnet add package SimpleORMDotNet --version 1.0.0
NuGet\Install-Package SimpleORMDotNet -Version 1.0.0
<PackageReference Include="SimpleORMDotNet" Version="1.0.0" />
<PackageVersion Include="SimpleORMDotNet" Version="1.0.0" />
<PackageReference Include="SimpleORMDotNet" />
paket add SimpleORMDotNet --version 1.0.0
#r "nuget: SimpleORMDotNet, 1.0.0"
#:package SimpleORMDotNet@1.0.0
#addin nuget:?package=SimpleORMDotNet&version=1.0.0
#tool nuget:?package=SimpleORMDotNet&version=1.0.0
SimpleORMDotNet
A high-performance, dependency-free ORM for .NET 10+, specifically designed for Native AOT.
Features
- Built-in Drivers: No need for Npgsql or Microsoft.Data.Sqlite.
- Source Generated: Zero reflection at runtime.
- AOT Ready: Fully compatible with Native AOT trimming.
- Thread-Safe: Integrated connection pooling.
- Simple API: Use attributes to define your data model.
- Fluent Configuration: Use EntityModelBuilder attribute for advanced entity configuration.
Supported Databases
| Database | Type ID | Status |
|---|---|---|
| SQLite | 0 | ✅ Implemented |
| PostgreSQL | 1 | ✅ Implemented |
| Cassandra | 3 | ✅ Implemented |
| MongoDB | 4 | ✅ Implemented |
| CouchDB | 5 | ✅ Implemented |
| SQL Server | 6 | ✅ Implemented |
| MySQL | 7 | ✅ Implemented |
All database protocols are implemented natively with zero external dependencies.
Installation
Add the SimpleORMDotNet project to your solution and reference it from your application project. The source generator is automatically included.
If you plan to use PostgreSQL or SQLite, ensure you have the appropriate native drivers installed (not required for SQLite as it uses built-in engine).
Quick Start
1. Define your Entity
using SimpleORMDotNet.Attributes;
public class User
{
[PrimaryKey]
public int Id { get; set; }
public string Name { get; set; } = "";
}
2. Define your Context
using SimpleORMDotNet;
using SimpleORMDotNet.Attributes;
[StaticDbContext(1)] // 1 = Postgres, 0 = Sqlite
public partial class AppDbContext : StaticDbContext
{
public StaticSet<User> Users { get; }
}
3. Usage
string connectionString = "Host=localhost;Database=mydb;User=postgres;";
AppDbContext db = new AppDbContext(connectionString);
// Add a user
db.Users.Add(new User { Name = "Alice" });
await db.SaveChangesAsync();
// Query users
List<User> users = await db.Users.ToListAsync();
// Raw SQL
List<User> bob = await db.Users.FromSqlInterpolatedAsync($"SELECT * FROM Users WHERE Name = {"Bob"}");
Documentation
See the Wiki for detailed documentation.
| 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. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v1.0.0: Production-ready release with Native AOT support, automatic migrations, 6 database providers, comprehensive documentation, and extensive testing. 1.5-10x faster than EF Core in most scenarios.