ServiceStack.OrmLite   Fast, simple, config-free, code-first POCO ORM for .NET

Fast, Lightweight ORM providing intuitive, Typed API's over ADO.NET's core interfaces

Use typed, intuitive apis for simplifying talking to RDBMS's:

var dbFactory = new OrmLiteConnectionFactory(
    ":memory:", SqliteDialect.Provider);
using (IDbConnection db = dbFactory.Open())
{
    db.DropAndCreateTable<Todo>();
    var todo = new Todo
    {
        Content = "Learn OrmLite",
        Order = 1,
    };

    db.Save(todo);

    var savedTodo = db.SingleById<Todo>(todo.Id);
    savedTodo.Content = "Updated";
    db.Save(savedTodo);

    "Updated Todo:".Print();
    db.Select<Todo>(q => q.Content == "Updated").PrintDump();
                
    db.DeleteById<Todo>(savedTodo.Id);

    "No more Todos:".Print();
    db.Select<Todo>().PrintDump();
}
  1. Create a DB factory with Sql Dialect you want to use
  2. Get an ADO.NET IDbConnection from the Connection Factory
  3. Drop and create new Todo table using schema from the Todo POCO
  4. Create new instance of Todo POCO
  5. Save item in DB (inserts if doesn't exist)
  6. Select single Todo item by id
  7. Update item
  8. Save item in DB (updates if exists)
  9. Use typed expression to print dump of "Updated" Todo items
  10. Delete Todo item by id
  11. Print dump of all Todo items in Todo table after delete

 

Create schema's from code-first POCO's, supports foreign keys, indexes, multi-nested database connections, convenience API's for common data access patterns, querying with typed-expressions, whilst providing seamless access raw SQL and ADO.NET transactions whenever needed.

Download

Sql Server

PM> Install-Package ServiceStack.OrmLite.SqlServer

Signed version:

PM> Install-Package ServiceStack.OrmLite.SqlServer.Signed

My SQL

PM> Install-Package ServiceStack.OrmLite.MySql

Signed version:

PM> Install-Package ServiceStack.OrmLite.MySql.Signed

PostgreSQL

PM> Install-Package ServiceStack.OrmLite.PostgreSQL

Sqlite

PM> Install-Package ServiceStack.OrmLite.Sqlite

Signed version:

PM> Install-Package ServiceStack.OrmLite.Sqlite.Windows.Signed

Royalty-Free Pricing
Indie*
Business
POPULAR
Indie Renewal* Software Updates and Commercial Support for an additional 12 months
Business Renewal Software Updates and Commercial Support for an additional 12 months

* Permitted Use

Companies or incorporated entities with more than 10 employees must purchase a Business plan (excl. registered non-profit organizations).