Example #1
0
        internal DbCachingPolicy Merge(CacheableEntityAttribute attribute)
        {
            // Merge global policy with query policy
            if (ExpirationTimeout == null && attribute?.Expiry > 0)
            {
                ExpirationTimeout = TimeSpan.FromMinutes(attribute.Expiry);
            }

            if (MaxRows == null && attribute?.MaxRows > 0)
            {
                MaxRows = attribute.MaxRows;
            }

            return(this);
        }
Example #2
0
 public DbCachingPolicy(CacheableEntityAttribute attribute)
 {
     NoCaching = attribute.NeverCache;
     Merge(attribute);
 }