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())
    var todo = new Todo
        Content = "Learn OrmLite",
        Order = 1,


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

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

    "No more Todos:".Print();
  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.

NuGet packages contains support for both .NET v4.5+ and .NET Standard 2.0.
Use .Core packages if running ASP.NET Core on .NET Framework.

SQL Server

PM> Install-Package ServiceStack.OrmLite.SqlServer

Using SQL Server 2012 specific SqlGeography, SqlGeometry and SqlHierarchyId Types:

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


PM> Install-Package ServiceStack.OrmLite.MySql

Using Async MySqlConnector:

PM> Install-Package erviceStack.OrmLite.MySqlConnector


PM> Install-Package ServiceStack.OrmLite.PostgreSQL


PM> Install-Package ServiceStack.OrmLite.Sqlite

Royalty-Free Pricing
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).