Skip to content

Instantly share code, notes, and snippets.

@alistairjevans
Created October 24, 2019 11:36
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 alistairjevans/8f032de89a9f7a39cc0589f3469fa678 to your computer and use it in GitHub Desktop.
Save alistairjevans/8f032de89a9f7a39cc0589f3469fa678 to your computer and use it in GitHub Desktop.
Dispose Async
await using (var dbConnection = new SqlConnection(connString))
{
// Use your DB connection.
// The connection will get disposed of asynchronously at the end of the using block.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment