Hello,
As far as I've tested, it seems that when a CACHE MISS happen the "Create Factory" is called.
When this happen and the factory also returns null (like for example db.FirstOrDefault(id), then the null value is also propagated to the cache.
This create quite some noise for cached object lifetime managment.
It would be nice to be able to pass a value inside the already existing Options parameter of the GetOrCreateAsync that tells the factory:
"If the factory returns null, don't bother settings null in cache"
Hello,
As far as I've tested, it seems that when a CACHE MISS happen the "Create Factory" is called.
When this happen and the factory also returns
null(like for exampledb.FirstOrDefault(id), then thenullvalue is also propagated to the cache.This create quite some noise for cached object lifetime managment.
It would be nice to be able to pass a value inside the already existing
Optionsparameter of theGetOrCreateAsyncthat tells the factory:"If the factory returns
null, don't bother settingsnullin cache"