I have two Model with same property name as
Class Office<br>
{
int Id;
string Name;
Location Location;
}
Class Location
{
int Id;
string Name;
}
sqlConnection.Query<Office, Location, Office>("query", (o, l) => {o.Location=l}, splitOn="Id,Id").ToList();
How can i make it work.
Any help appreciated.
well, you just forget return your new object in delegate
(o, l) => {o.Location=l; return o;}
i.e. you should wrote:
sqlConnection.Query<Office, Location, Office>("query", (o, l) => {o.Location=l; return o;}, splitOn="Id,Id").ToList();