Skip to content

Instantly share code, notes, and snippets.



Last active Sep 30, 2016
What would you like to do?
LoadSelect Example
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
var db = dbFactory.Open(); // Open ADO.NET DB Connection
public class Foo
public int Id {get;set;}
public string Name {get;set;}
public class Todo
public long Id { get; set; }
public string Content { get; set; }
public int Order { get; set; }
public bool Done { get; set; }
public int FooId { get; set; }
public Foo FooVal { get; set; }
var fooNew = new Foo {
Name = "Test"
var newTodo = new Todo {
Content = "Learn OrmLite",
Order = 1,
FooId = 1
var loadSelected = db.LoadSelect(db.From<Todo>().Join<Foo>().Where(x => x.FooId == 1));
"LoadSelect Todo: {0}".Print(loadSelected.Dump());
<?xml version="1.0" encoding="utf-8"?>
<package id="ServiceStack.Text" version="4.5.0" targetFramework="net45" />
<package id="ServiceStack.Interfaces" version="4.5.0" targetFramework="net45" />
<package id="ServiceStack.Common" version="4.5.0" targetFramework="net45" />
<package id="ServiceStack.OrmLite" version="4.5.0" targetFramework="net45" />
<package id="ServiceStack.OrmLite.Sqlite.Mono" version="4.5.0" targetFramework="net45" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.