Class DistributedCache<TCacheItem>
Inheritance
object
DistributedCache<TCacheItem>
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Assembly: Volo.Abp.Caching.dll
Syntax
public class DistributedCache<TCacheItem> : IDistributedCache<TCacheItem>, IDistributedCache<TCacheItem, string> where TCacheItem : class
Type Parameters
| Name |
Description |
| TCacheItem |
|
Constructors
DistributedCache(IDistributedCache<TCacheItem, string>)
Declaration
public DistributedCache(IDistributedCache<TCacheItem, string> internalCache)
Parameters
Properties
InternalCache
Declaration
public IDistributedCache<TCacheItem, string> InternalCache { get; }
Property Value
Methods
Get(string, bool?, bool)
Declaration
public TCacheItem Get(string key, bool? hideErrors = null, bool considerUow = false)
Parameters
| Type |
Name |
Description |
| string |
key |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
Returns
| Type |
Description |
| TCacheItem |
|
GetAsync(string, bool?, bool, CancellationToken)
Declaration
public Task<TCacheItem> GetAsync(string key, bool? hideErrors = null, bool considerUow = false, CancellationToken token = default)
Parameters
| Type |
Name |
Description |
| string |
key |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
| System.Threading.CancellationToken |
token |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task<TResult><TCacheItem> |
|
GetMany(IEnumerable<string>, bool?, bool)
Declaration
public KeyValuePair<string, TCacheItem>[] GetMany(IEnumerable<string> keys, bool? hideErrors = null, bool considerUow = false)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<T><string> |
keys |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
Returns
| Type |
Description |
| KeyValuePair<string, TCacheItem>[] |
|
GetManyAsync(IEnumerable<string>, bool?, bool, CancellationToken)
Declaration
public Task<KeyValuePair<string, TCacheItem>[]> GetManyAsync(IEnumerable<string> keys, bool? hideErrors = null, bool considerUow = false, CancellationToken token = default)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<T><string> |
keys |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
| System.Threading.CancellationToken |
token |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task<TResult><KeyValuePair<string, TCacheItem>[]> |
|
GetOrAdd(string, Func<TCacheItem>, Func<DistributedCacheEntryOptions>, bool?, bool)
Declaration
public TCacheItem GetOrAdd(string key, Func<TCacheItem> factory, Func<DistributedCacheEntryOptions> optionsFactory = null, bool? hideErrors = null, bool considerUow = false)
Parameters
| Type |
Name |
Description |
| string |
key |
|
| System.Func<TResult><TCacheItem> |
factory |
|
| System.Func<TResult><Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions> |
optionsFactory |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
Returns
| Type |
Description |
| TCacheItem |
|
GetOrAddAsync(string, Func<Task<TCacheItem>>, Func<DistributedCacheEntryOptions>, bool?, bool, CancellationToken)
Declaration
public Task<TCacheItem> GetOrAddAsync(string key, Func<Task<TCacheItem>> factory, Func<DistributedCacheEntryOptions> optionsFactory = null, bool? hideErrors = null, bool considerUow = false, CancellationToken token = default)
Parameters
| Type |
Name |
Description |
| string |
key |
|
| System.Func<TResult><System.Threading.Tasks.Task<TResult><TCacheItem>> |
factory |
|
| System.Func<TResult><Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions> |
optionsFactory |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
| System.Threading.CancellationToken |
token |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task<TResult><TCacheItem> |
|
GetOrAddMany(IEnumerable<string>, Func<IEnumerable<string>, List<KeyValuePair<string, TCacheItem>>>, Func<DistributedCacheEntryOptions>, bool?, bool)
Declaration
public KeyValuePair<string, TCacheItem>[] GetOrAddMany(IEnumerable<string> keys, Func<IEnumerable<string>, List<KeyValuePair<string, TCacheItem>>> factory, Func<DistributedCacheEntryOptions> optionsFactory = null, bool? hideErrors = null, bool considerUow = false)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<T><string> |
keys |
|
| System.Func<T, TResult><System.Collections.Generic.IEnumerable<T><string>, System.Collections.Generic.List<T><KeyValuePair<string, TCacheItem>>> |
factory |
|
| System.Func<TResult><Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions> |
optionsFactory |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
Returns
| Type |
Description |
| KeyValuePair<string, TCacheItem>[] |
|
GetOrAddManyAsync(IEnumerable<string>, Func<IEnumerable<string>, Task<List<KeyValuePair<string, TCacheItem>>>>, Func<DistributedCacheEntryOptions>, bool?, bool, CancellationToken)
Declaration
public Task<KeyValuePair<string, TCacheItem>[]> GetOrAddManyAsync(IEnumerable<string> keys, Func<IEnumerable<string>, Task<List<KeyValuePair<string, TCacheItem>>>> factory, Func<DistributedCacheEntryOptions> optionsFactory = null, bool? hideErrors = null, bool considerUow = false, CancellationToken token = default)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<T><string> |
keys |
|
| System.Func<T, TResult><System.Collections.Generic.IEnumerable<T><string>, System.Threading.Tasks.Task<TResult><System.Collections.Generic.List<T><KeyValuePair<string, TCacheItem>>>> |
factory |
|
| System.Func<TResult><Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions> |
optionsFactory |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
| System.Threading.CancellationToken |
token |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task<TResult><KeyValuePair<string, TCacheItem>[]> |
|
Refresh(string, bool?)
Declaration
public void Refresh(string key, bool? hideErrors = null)
Parameters
| Type |
Name |
Description |
| string |
key |
|
| bool? |
hideErrors |
|
RefreshAsync(string, bool?, CancellationToken)
Declaration
public Task RefreshAsync(string key, bool? hideErrors = null, CancellationToken token = default)
Parameters
| Type |
Name |
Description |
| string |
key |
|
| bool? |
hideErrors |
|
| System.Threading.CancellationToken |
token |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
RefreshMany(IEnumerable<string>, bool?)
Declaration
public void RefreshMany(IEnumerable<string> keys, bool? hideErrors = null)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<T><string> |
keys |
|
| bool? |
hideErrors |
|
RefreshManyAsync(IEnumerable<string>, bool?, CancellationToken)
Declaration
public Task RefreshManyAsync(IEnumerable<string> keys, bool? hideErrors = null, CancellationToken token = default)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<T><string> |
keys |
|
| bool? |
hideErrors |
|
| System.Threading.CancellationToken |
token |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
Remove(string, bool?, bool)
Declaration
public void Remove(string key, bool? hideErrors = null, bool considerUow = false)
Parameters
| Type |
Name |
Description |
| string |
key |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
RemoveAsync(string, bool?, bool, CancellationToken)
Declaration
public Task RemoveAsync(string key, bool? hideErrors = null, bool considerUow = false, CancellationToken token = default)
Parameters
| Type |
Name |
Description |
| string |
key |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
| System.Threading.CancellationToken |
token |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
RemoveMany(IEnumerable<string>, bool?, bool)
Declaration
public void RemoveMany(IEnumerable<string> keys, bool? hideErrors = null, bool considerUow = false)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<T><string> |
keys |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
RemoveManyAsync(IEnumerable<string>, bool?, bool, CancellationToken)
Declaration
public Task RemoveManyAsync(IEnumerable<string> keys, bool? hideErrors = null, bool considerUow = false, CancellationToken token = default)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<T><string> |
keys |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
| System.Threading.CancellationToken |
token |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
Set(string, TCacheItem, DistributedCacheEntryOptions, bool?, bool)
Declaration
public void Set(string key, TCacheItem value, DistributedCacheEntryOptions options = null, bool? hideErrors = null, bool considerUow = false)
Parameters
| Type |
Name |
Description |
| string |
key |
|
| TCacheItem |
value |
|
| Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions |
options |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
SetAsync(string, TCacheItem, DistributedCacheEntryOptions, bool?, bool, CancellationToken)
Declaration
public Task SetAsync(string key, TCacheItem value, DistributedCacheEntryOptions options = null, bool? hideErrors = null, bool considerUow = false, CancellationToken token = default)
Parameters
| Type |
Name |
Description |
| string |
key |
|
| TCacheItem |
value |
|
| Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions |
options |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
| System.Threading.CancellationToken |
token |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
SetMany(IEnumerable<KeyValuePair<string, TCacheItem>>, DistributedCacheEntryOptions, bool?, bool)
Declaration
public void SetMany(IEnumerable<KeyValuePair<string, TCacheItem>> items, DistributedCacheEntryOptions options = null, bool? hideErrors = null, bool considerUow = false)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<T><KeyValuePair<string, TCacheItem>> |
items |
|
| Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions |
options |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
SetManyAsync(IEnumerable<KeyValuePair<string, TCacheItem>>, DistributedCacheEntryOptions, bool?, bool, CancellationToken)
Declaration
public Task SetManyAsync(IEnumerable<KeyValuePair<string, TCacheItem>> items, DistributedCacheEntryOptions options = null, bool? hideErrors = null, bool considerUow = false, CancellationToken token = default)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<T><KeyValuePair<string, TCacheItem>> |
items |
|
| Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions |
options |
|
| bool? |
hideErrors |
|
| bool |
considerUow |
|
| System.Threading.CancellationToken |
token |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
Implements
Extension Methods