Skip to content

Commit 09c1bba

Browse files
bkoelmandennisdoomen
authored andcommitted
Correct example in AV2235 that was not using Task<T> (#172)
1 parent c798273 commit 09c1bba

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

_pages/2200_FrameworkGuidelines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Use it only for calling methods or members of a dynamically created instance cla
9999
### <a name="av2235"></a> Favor `async`/`await` over `Task` continuations (AV2235) ![](/assets/images/1.png)
100100
Using the new C# 5.0 keywords results in code that can still be read sequentially and also improves maintainability a lot, even if you need to chain multiple asynchronous operations. For example, rather than defining your method like this:
101101

102-
public Task GetDataAsync()
102+
public Task<Data> GetDataAsync()
103103
{
104104
return MyWebService.FetchDataAsync()
105105
.ContinueWith(t => new Data(t.Result));

0 commit comments

Comments
 (0)