Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
string sql = $@"SELECT [Tracks].[Id], [Tracks].[Title],
[Drivers].[Id], [Drivers].[FirstName], [Drivers].[LastName], [Drivers].[ChampionTitleCount]
FROM [Tracks]
INNER JOIN [Drivers]
ON [Drivers].[Id] = [Tracks].[BestLapTimeDriverId]
WHERE [Tracks].[Id] = 1;";
Track track = (await connection.QueryAsync<Track, Driver, Track>(sql, (t, d) =>
{
t.BestLapTimeDriver = d;
return t;
})).FirstOrDefault();
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.