Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
You can’t perform that action at this time.