Created
June 8, 2018 13:42
-
-
Save ssougnez/5d58e588be9bc72985d6c272e6b56a79 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 [Id], [Title] FROM [Tracks] WHERE [Tracks].[Id] = 1; | |
SELECT [Id], [FirstName], [LastName] FROM [Drivers] WHERE [Id] IN (SELECT [DriverId] FROM [TrackWinners] WHERE [TrackWinners].[TrackId] = 1)"; | |
using (var reader = await connection.QueryMultipleAsync(sql)) | |
{ | |
var track = reader.Read<Track>().FirstOrDefault(); | |
if (track != null) | |
{ | |
track.Winners = reader.Read<Driver>().ToList(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment