Created
September 19, 2018 05:55
-
-
Save idg10/9739b7358b65b496ecfa7758bf595557 to your computer and use it in GitHub Desktop.
Incorrect resource handling with Task-based deferred execution
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
// This doesn't work. | |
public static Task<string> GetContentAsync(string configPath) | |
{ | |
using (var reader = new StreamReader(configPath)) | |
{ | |
return reader.ReadToEndAsync(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment