Show / Hide Table of Contents

Class DistributedCache<TCacheItem>

Inheritance
object
DistributedCache<TCacheItem>
Implements
IDistributedCache<TCacheItem>
IDistributedCache<TCacheItem, string>
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Volo.Abp.Caching
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
Type Name Description
IDistributedCache<TCacheItem, string> internalCache

Properties

InternalCache

Declaration
public IDistributedCache<TCacheItem, string> InternalCache { get; }
Property Value
Type Description
IDistributedCache<TCacheItem, string>

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
CancellationToken token
Returns
Type Description
Task<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
IEnumerable<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
IEnumerable<string> keys
bool? hideErrors
bool considerUow
CancellationToken token
Returns
Type Description
Task<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
Func<TCacheItem> factory
Func<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
Func<Task<TCacheItem>> factory
Func<DistributedCacheEntryOptions> optionsFactory
bool? hideErrors
bool considerUow
CancellationToken token
Returns
Type Description
Task<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
IEnumerable<string> keys
Func<IEnumerable<string>, List<KeyValuePair<string, TCacheItem>>> factory
Func<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
IEnumerable<string> keys
Func<IEnumerable<string>, Task<List<KeyValuePair<string, TCacheItem>>>> factory
Func<DistributedCacheEntryOptions> optionsFactory
bool? hideErrors
bool considerUow
CancellationToken token
Returns
Type Description
Task<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
CancellationToken token
Returns
Type Description
Task

RefreshMany(IEnumerable<string>, bool?)

Declaration
public void RefreshMany(IEnumerable<string> keys, bool? hideErrors = null)
Parameters
Type Name Description
IEnumerable<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
IEnumerable<string> keys
bool? hideErrors
CancellationToken token
Returns
Type Description
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
CancellationToken token
Returns
Type Description
Task

RemoveMany(IEnumerable<string>, bool?, bool)

Declaration
public void RemoveMany(IEnumerable<string> keys, bool? hideErrors = null, bool considerUow = false)
Parameters
Type Name Description
IEnumerable<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
IEnumerable<string> keys
bool? hideErrors
bool considerUow
CancellationToken token
Returns
Type Description
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
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
DistributedCacheEntryOptions options
bool? hideErrors
bool considerUow
CancellationToken token
Returns
Type Description
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
IEnumerable<KeyValuePair<string, TCacheItem>> items
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
IEnumerable<KeyValuePair<string, TCacheItem>> items
DistributedCacheEntryOptions options
bool? hideErrors
bool considerUow
CancellationToken token
Returns
Type Description
Task

Implements

IDistributedCache<TCacheItem>
IDistributedCache<TCacheItem, TCacheKey>

Extension Methods

AbpObjectExtensions.As<T>(object)
AbpObjectExtensions.To<T>(object)
LockExtensions.Locking(object, Action)
LockExtensions.Locking<TResult>(object, Func<TResult>)
AbpObjectExtensions.If<T>(T, bool, Action<T>)
AbpObjectExtensions.If<T>(T, bool, Func<T, T>)
AbpObjectExtensions.IsIn<T>(T, IEnumerable<T>)
AbpObjectExtensions.IsIn<T>(T, params T[])
AbpQueryableExtensions.OrderByIf<T, TQueryable>(TQueryable, bool, string)
AbpQueryableExtensions.PageBy<T, TQueryable>(TQueryable, int, int)
AbpQueryableExtensions.WhereIf<T, TQueryable>(TQueryable, bool, Expression<Func<T, bool>>)
AbpQueryableExtensions.WhereIf<T, TQueryable>(TQueryable, bool, Expression<Func<T, int, bool>>)
AbpOpenIddictQueryableExtensions.SkipIf<T, TQueryable>(TQueryable, bool, int?)
AbpOpenIddictQueryableExtensions.TakeIf<T, TQueryable>(TQueryable, bool, int?)
LockExtensions.Locking<T>(T, Action<T>)
LockExtensions.Locking<T, TResult>(T, Func<T, TResult>)
In this article
Back to top Powered by ABP.IO Platform