/// <summary> /// 获取K/V键对集合 /// </summary> /// <typeparam name="T">类型</typeparam> /// <param name="keys">键集合</param> /// <returns>返回键/值对的泛型集合</returns> /// <remarks> /// <para>创建:范亮</para> /// <para>日期:2016/4/5</para> /// </remarks> public IDictionary <string, T> Get <T>(IEnumerable <string> keys) { var enumerable = keys as string[] ?? keys.ToArray(); enumerable.ForEach(key => key = GetKeySuffix(key)); return(WebCache.Get <T>(enumerable)); }
/// <summary> /// 异步获取K/V键对集合 /// </summary> /// <typeparam name="T">类型</typeparam> /// <param name="keys">键集合</param> /// <returns>返回键/值对的泛型集合</returns> /// <remarks> /// <para>创建:范亮</para> /// <para>日期:2016/4/5</para> /// </remarks> public async Task <IDictionary <string, T> > GetAsync <T>(IEnumerable <string> keys) { var enumerable = keys as string[] ?? keys.ToArray(); enumerable.ForEach(key => key = GetKeySuffix(key)); var result = await Task.Run(() => WebCache.Get <T>(enumerable)); return(result); }
/// <summary> /// 根据KEY键异步获取返回指定的类型对象 /// </summary> /// <typeparam name="T">返回类型</typeparam> /// <param name="key">KEY值</param> /// <returns>需要返回的对象</returns> /// <remarks> /// <para>创建:范亮</para> /// <para>日期:2016/4/5</para> /// </remarks> public async Task <T> GetAsync <T>(string key) { var result = await Task.Run(() => WebCache.Get <T>(GetKeySuffix(key))); return(result); }
/// <summary> /// 根据KEY键获取返回指定的类型对象 /// </summary> /// <typeparam name="T">返回类型</typeparam> /// <param name="key">KEY值</param> /// <returns>需要返回的对象</returns> /// <remarks> /// <para>创建:范亮</para> /// <para>日期:2016/4/5</para> /// </remarks> public T Get <T>(string key) { return(WebCache.Get <T>(GetKeySuffix(key))); }
/// <summary> /// 根据KEY键获取返回对象 /// </summary> /// <param name="key">键</param> /// <returns>返回对象</returns> /// <remarks> /// <para>创建:范亮</para> /// <para>日期:2016/4/5</para> /// </remarks> public object Get(string key) { return(WebCache.Get(GetKeySuffix(key))); }