Closed akhlebus closed 5 years ago
Hi David, example with AsyncLazy doesn't compile as AsyncLazy is not awaitable.
To fix that
var person = await _cache.GetOrAdd(id, (key) => new AsyncLazy<Person>(() => db.People.FindAsync(key)));
should be replaced with
var person = await _cache.GetOrAdd(id, (key) => new AsyncLazy<Person>(() => db.People.FindAsync(key))).Value;
Oh, the issue has already been fixed in master with https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/pull/39.
Hi David, example with AsyncLazy doesn't compile as AsyncLazy is not awaitable.
To fix that
should be replaced with