davidfowl / AspNetCoreDiagnosticScenarios

This repository has examples of broken patterns in ASP.NET Core applications
7.69k stars 740 forks source link

Update AsyncGuidance.md #39

Closed maxhauser closed 5 years ago

maxhauser commented 5 years ago

Call .Value on Lazy<> result.

slang25 commented 5 years ago

Shouldn't the .Value go before the await? The pattern is to usually have Lazy<Task<T>> rather than Task<Lazy<T>>.

Edit: Sorry, just realised this is caching not Lazy 🤦‍♂️

maxhauser commented 5 years ago

Yes, you are totally right. I fixed that (the position of the .Value property was wrong as well). Thank you.