How to Select
data using Service.OrmLite
from two tables JOIN
without creating another Poco (Coal+Data) only for that purpose.
I have Poco for Coal and for CoalData like:
class Coal {
// PK
public long Id {get; set;}
public string Name {get; set;}
}
class CoalData {
// FK
public long Id {get; set;}
public int Prop1 {get; set;}
....
}
In Dapper it's simple like:
var personWithAddress = connection
.Query<Person, Address, Extra, Tuple<Person, Address, Extra>>
(sql, (p, a, e) => Tuple.Create(p, a, e), splitOn: "AddressId,Id").First();