Might be a trivial question, but it might help me in basic understanding.

Is there any important difference between two following implementations?

  1. Task.Factory.StartNew:

    public Task<string> ReadAllTextAsync(string path) {
        return Task.Factory.StartNew(() => File.ReadAllText(path));
    }
    
  2. 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();
        }
    }
    
Edit
Report