Skip to content

Instantly share code, notes, and snippets.

@ssougnez
Last active June 8, 2018 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssougnez/f7c986b6d7909b7d16c17e165718ca2e to your computer and use it in GitHub Desktop.
Save ssougnez/f7c986b6d7909b7d16c17e165718ca2e to your computer and use it in GitHub Desktop.
string sql = $@"INSERT INTO [Drivers] ([FirstName], [LastName], [ChampionTitleCount]) VALUES (@FirstName, @LastName, @ChampionTitleCount);
SELECT CAST(SCOPE_IDENTITY() AS int);";
await connection.ExecuteAsync(sql, new
{
FirstName = "Sebastian",
LastName = "Vettel",
ChampionTitleCount = 4
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment