public static CacheSettings WithProvider(this CacheSettings settings, string provider) { settings.Provider = provider; return(settings); }
public static CacheSettings WithGroup(this CacheSettings settings, string group) { settings.Group = group; return(settings); }
public static CacheSettings AddCacheDependency <T>(this CacheSettings settings, IQueryable <T> queryable, params ITable[] sqlCacheDependencyTables) { return(AddCacheDependency(settings, queryable.GetDataContext().Connection.Database, sqlCacheDependencyTables)); }
public static CacheSettings WithCacheItemRemovedCallback(this CacheSettings settings, CacheItemRemovedCallback cacheItemRemovedCallback) { settings.CacheItemRemovedCallback = cacheItemRemovedCallback; return(settings); }
public static CacheSettings AddCacheDependency(this CacheSettings settings, params CacheDependency[] cacheDependencies) { return(AddCacheDependency(settings, (IEnumerable <CacheDependency>)cacheDependencies)); }
public static CacheSettings AddCacheDependency(this CacheSettings settings, params SqlCacheDependency[] cacheDependencies) { return(AddCacheDependency(settings, cacheDependencies.Cast <CacheDependency>())); }
public static CacheSettings WithCacheEmptyResult(this CacheSettings settings, bool cacheEmptyResult) { settings.CacheEmptyResult = cacheEmptyResult; return(settings); }
public static CacheSettings WithCacheDependency(this CacheSettings settings, CacheDependency cacheDependency) { settings.CacheDependency = cacheDependency; return(settings); }
public static CacheSettings WithPriority(this CacheSettings settings, CacheItemPriority priority) { settings.Priority = priority; return(settings); }
public static CacheSettings WithAbsoluteExpiration(this CacheSettings settings, DateTime absoluteExpiration) { settings.AbsoluteExpiration = absoluteExpiration; settings.Mode = CacheExpirationMode.Absolute; return(settings); }
public static CacheSettings WithDuration(this CacheSettings settings, TimeSpan duration) { settings.Duration = duration; settings.Mode = CacheExpirationMode.Duration; return(settings); }
public static CacheSettings WithDuration(this CacheSettings settings, int duration) { settings.Duration = TimeSpan.FromSeconds(duration); settings.Mode = CacheExpirationMode.Duration; return(settings); }
/// <summary> /// Saves the specified key to the cache provider. /// </summary> /// <typeparam name="T">The type for data being saved,</typeparam> /// <param name="key">The key used to store the data in the cache provider.</param> /// <param name="data">The data to be cached in the provider.</param> /// <param name="settings">The <see cref="CacheSettings"/> to be used when storing in the provider.</param> public abstract void Set <T>(string key, T data, CacheSettings settings);