Introduce nullable properties in the [Cache] attribute to set MemoryCacheEntryOptions for cache entries.
These 3 properties should be implemented and if set, passed to the MemoryCache.Set call by using the MemoryCacheEntryOptions parameter:
- int AbsoluteExpirationRelativeToNow (in seconds)
- int SlidingExpiration (in seconds)
- CacheItemPriority Priority
Code sample:
[Cache(SlidingExpiration=10,Priority=CacheItemPriority.Low)]publicclassBasicSample{// ...}
Introduce nullable properties in the
[Cache]attribute to setMemoryCacheEntryOptionsfor cache entries.These 3 properties should be implemented and if set, passed to the
MemoryCache.Setcall by using theMemoryCacheEntryOptionsparameter:Code sample: