LazyCache icon indicating copy to clipboard operation
LazyCache copied to clipboard

GetOrAddAsync doesn't call GetOrCreateAsync in the provider

Open replaysMike opened this issue 4 years ago • 0 comments

Trying to write a Redis provider for the current version of LazyCache. Ended up hitting a wall with the current implementation.

The bug When calling _cache.GetOrAddAsync() the caching service calls the GetOrCreate on the underlying provider instead of GetOrCreateAsync. This prevents the task from being unwrapped correctly and the resulting object is wrong.

CachingService.cs:172 and CachingService.cs:192.

Couldn't find an easy way around it because of the way the CacheFactory is used, and passes the type as an object

replaysMike avatar Mar 31 '20 03:03 replaysMike