You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The doc explains how to add two items to the cache using a Cancellation Token.
But why does the example calculates options2 to add the 2nd item to the cache?
Why is it not possible to just re-use options1 like this:?
var expireToken1 = new CancellationChangeToken(sharedExpiryTokenSource.Token);
var options1 = new MemoryCacheEntryOptions()
.AddExpirationToken(expireToken)
var product1 = cache.GetOrAdd($"Products-1", () => dbContext.Products.GetAsync(1), options1);
var product2 = cache.GetOrAdd($"Products-2", () => dbContext.Products.GetAsync(2), options1);
Thanks a lot, kind regards,
Thomas
The text was updated successfully, but these errors were encountered:
Hello,
thank you for sharing your great work!
Describe the bug
'bug' is the best matching issue type because the doc in Wiki is very useful, but it has still one open question:
Here: https://github.com/alastairtree/LazyCache/wiki/API-documentation-(v-2.x)
in Chapter: Method 2 - Cancellation Tokens (could also be used to dispose a range of items)
The doc explains how to add two items to the cache using a Cancellation Token.
But why does the example calculates
options2
to add the 2nd item to the cache?Why is it not possible to just re-use
options1
like this:?Thanks a lot, kind regards,
Thomas
The text was updated successfully, but these errors were encountered: