Created
June 8, 2018 13:38
-
-
Save ssougnez/92d0d75c363ef9057848b60bbb0f0a1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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