KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Might be a trivial question, but it might help me in basic understanding. Is there any important difference between two following implementations? Task.Factory.StartNew : public Task<string> ReadAllTextAsync(string path) { return Task.Factory.StartNew(() => File.ReadAllText(path)); } Async method on StreamReader : public async Task<string> ReadAllTextAsync(string path) { using (var stream = File.OpenRead(path)) using (var reader = new StreamReader(stream)) { return await reader.ReadToEndAsync(); } }
Tags (comma-separated)
Save Edits
Cancel