Created
October 24, 2019 11:36
-
-
Save alistairjevans/8f032de89a9f7a39cc0589f3469fa678 to your computer and use it in GitHub Desktop.
Dispose Async
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
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