chore
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Microsoft.Extensions.Caching.Distributed;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Atomx.Data.CacheServices
|
||||
{
|
||||
@@ -40,6 +41,12 @@ namespace Atomx.Data.CacheServices
|
||||
/// <returns></returns>
|
||||
Task Remove(string key);
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的字符串内容
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
Task<string?> GetCacheString(string key);
|
||||
|
||||
}
|
||||
|
||||
@@ -61,6 +68,10 @@ namespace Atomx.Data.CacheServices
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task<string?> GetCacheString(string key)
|
||||
{
|
||||
return await _cache.GetStringAsync(key);
|
||||
}
|
||||
|
||||
public T? GetCache<T>(string key)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user