Sdl.Web.Tridion/Providers/Caching/DD4TCacheProvider.cs
/// <summary>
/// Stores a given key/value pair to a given cache Region.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="region">The name of the cache region. Different cache regions can have different retention policies.</param>
/// <param name="value">The value. If <c>null</c>, this effectively removes the key from the cache.</param>
/// <param name="dependencies">An optional set of dependent item IDs. Can be used to invalidate the cached item.</param>
/// <typeparam name="T">The type of the value to add.</typeparam>
Stores a given key/value pair to a given cache Region.
Stores a given key / value pair to a given cache Region .
public override void Store<T>(string key, string region, T value, IEnumerable<string> dependencies = null)
        {
            List<string> dependsOnTcmUris = dependencies?.ToList();
            string cacheAgentKey = GetQualifiedKey(key, region);
            lock (_cacheAgent)
            {
                _cacheAgent.Remove(cacheAgentKey);
                if (value != null)
                {
                    _cacheAgent.Store(cacheAgentKey, region, value, dependsOnTcmUris);
                }
            }
        }
public override void Store < T > ( string key , string region , T value , IEnumerable < string > dependencies = null ) { List < string > dependsOnTcmUris = dependencies ? . ToList ( ) ; string cacheAgentKey = GetQualifiedKey ( key , region ) ; lock ( _cacheAgent ) { _cacheAgent . Remove ( cacheAgentKey ) ; if ( value != null ) { _cacheAgent . Store ( cacheAgentKey , region , value , dependsOnTcmUris ) ; } } }
Stores a given key/value pair to a given cache Region.
Stores a given key / value pair to a given cache Region .
key
string
None
region
string
The name of the cache region. Different cache regions can have different retention policies.
The name of the cache region . Different cache regions can have different retention policies .
value
T
The value. If null
The value . If null
dependencies
IEnumerable<string>
An optional set of dependent item IDs. Can be used to invalidate the cached item.
An optional set of dependent item IDs . Can be used to invalidate the cached item .
typeparam
The type of the value to add.
The type of the value to add .