Created
June 8, 2018 13:37
-
-
Save ssougnez/6f63ace045cb5e4b28e9d174cacf3a74 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] FROM [Drivers] WHERE [LastName] = 'Alonso';"; | |
int driverId = (await connection.QueryAsync<int>(sql)).FirstOrDefault(); | |
if (driverId != default) | |
{ | |
sql = $"INSERT INTO [Tracks] ([Title], [BestLapTimeDriverId]) VALUES ('Belgium', @DriverId);"; | |
await connection.ExecuteAsync(sql, new { DriverId = driverId }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment