Example #1
0
        public DateTimeOffset GetLastModifiedDate(string entityName)
        {
            entityName ??= string.Empty;

            var cacheKey = CacheKey.With(GetType(), nameof(GetLastModifiedDate), entityName);

            return(_memoryCache.GetOrCreateExclusive(cacheKey, options =>
            {
                options.AddExpirationToken(LastChangesCacheRegion.CreateChangeTokenForKey(entityName));

                return DateTimeOffset.UtcNow;
            }));
        }
Example #2
0
 public void Reset(string entityName)
 {
     LastChangesCacheRegion.ExpireTokenForKey(entityName);
 }