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);
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-useoptions1
like this:?Thanks a lot, kind regards, Thomas