public class MemoryCache<TKey, TValue> : IEnumerable<ICacheEntry<TKey, TValue>>,
IEnumerable, ICache<TKey, TValue>, ICacheAsync<TKey, TValue>
Public Class MemoryCache(Of TKey, TValue)
Implements IEnumerable(Of ICacheEntry(Of TKey, TValue)),
IEnumerable, ICache(Of TKey, TValue), ICacheAsync(Of TKey, TValue)
type MemoryCache<'TKey, 'TValue> =
class
interface IEnumerable<ICacheEntry<'TKey, 'TValue>>
interface IEnumerable
interface ICache<'TKey, 'TValue>
interface ICacheAsync<'TKey, 'TValue>
end
[缺少 "T:TouchSocket.Core.MemoryCache`2" 的 <typeparam name="TKey"/> 文档]
[缺少 "T:TouchSocket.Core.MemoryCache`2" 的 <typeparam name="TValue"/> 文档]
MemoryCacheTKey, TValue | 一个简单的内存缓存 |
Remove | 当每个元素超时被移除时触发。 |
AddCache | 添加缓存。当缓存存在时,不会添加成功。 |
AddCacheAsync | 添加缓存。当缓存存在时,不会添加成功。 |
ClearCache | 清空所有缓存 |
ClearCacheAsync | 清空所有缓存 |
ContainsCache | 判断缓存是否存在,且在生命周期内。 |
ContainsCacheAsync | 异步判断指定键的缓存是否存在且在生命周期内。 |
Equals | Determines whether the specified object is equal to the current object. (继承自 Object。) |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (继承自 Object。) |
GetCache | 获取指定键的缓存。 |
GetCacheAsync | 异步获取指定键的缓存条目。 |
GetEnumerator | Returns an enumerator that iterates through the collection. |
GetHashCode | Serves as the default hash function. (继承自 Object。) |
GetType | Gets the Type of the current instance. (继承自 Object。) |
MemberwiseClone | Creates a shallow copy of the current Object. (继承自 Object。) |
RemoveCache(TKey) | 移除指定键的缓存。 |
RemoveCache(TKey, ICacheEntryTKey, TValue) | |
RemoveCacheAsync | 异步移除缓存项。 |
SetCache | 设置缓存,不管缓存存不存在,都会添加。 |
SetCacheAsync | 设置缓存,不管缓存存不存在,都会添加。 |
ToString | Returns a string that represents the current object. (继承自 Object。) |
ForEachICacheEntryTKey, TValue |
循环遍历每个元素,执行Action动作
(由 CollectionsExtension 定义。) |
ForEachAsyncICacheEntryTKey, TValue |
循环遍历每个元素,执行异步动作
(由 CollectionsExtension 定义。) |
Map | (由 Mapper 定义。) |
Map | (由 Mapper 定义。) |
MapTTarget | (由 Mapper 定义。) |
MapListICacheEntryTKey, TValue, T1 | (由 Mapper 定义。) |
ToJsonString |
转换为Json
(由 SerializeConvert 定义。) |
IEnumerableGetEnumerator | Returns an enumerator that iterates through a collection. |