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();
}
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.
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
Companies or incorporated entities with more than 10 employees must purchase a Business plan (excl. registered non-profit organizations).