var sql = @"select * from Customer where Id = @id
select * from ProfileCode where CustomerId = @id";
using (var db = _dbFactory.OpenDbConnection())
using (var multi = db.QueryMultiple(sql, new { id = 2 }))
{
var customer = multi.Read<Customer>().Single();
customer.ProfileCodes = multi.Read<ProfileCode>().ToList();
Console.WriteLine("Customer: " + customer.Dump());
}
Of course, you’ll need to using ServiceStack.OrmLite.Dapper; to get to QueryMultiple.