Abp.Runtime.Caching.ICache.GetOrDefault(string)

Here are the examples of the csharp api class Abp.Runtime.Caching.ICache.GetOrDefault(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

1. Example

View license
public static TValue GetOrDefault<TKey, TValue>(this ICache cache, TKey key)
        {
            var value = cache.GetOrDefault(key.ToString());
            if (value == null)
            {
                return default(TValue);
            }

            return (TValue) value;
        }

2. Example

View license
public string Find(string storeKey)
        {
            Check.NotNullOrWhiteSpace(storeKey, nameof(storeKey));

            var code = _cacheManager.GetCache(DefaultCacheName).GetOrDefault<string, string>(storeKey);

            if (code.IsNullOrWhiteSpace())
            {
                return string.Empty;
            }

            return code;
        }