/// <summary>
 /// 获取缓存的值
 /// </summary>
 /// <param name="cacheName"></param>
 /// <returns></returns>
 public static object GetUpdataObject(string cacheName)
 {
     if (CacheObjectData.ContainsKey(cacheName))
     {
         DataObjectModel model = CacheObjectData[cacheName];
         if (DateTime.Now > model.LastRequestTime.Add(model.TimeSpan))
         {
             lock (model.DataObject)
             {
                 if (DateTime.Now > model.LastRequestTime.Add(model.TimeSpan))
                 {
                     model.DataObject = model.Function.Invoke(model.args);
                 }
                 else
                 {
                     return(model.DataObject);
                 }
             }
             return(model.DataObject);
         }
         else
         {
             return(model.DataObject);
         }
     }
     else
     {
         return("缓存管理器中不包含该缓存");
     }
 }
 /// <summary>
 /// 设置缓存
 /// </summary>
 /// <param name="timeSpan">多久更新一次</param>
 /// <param name="cacheName">缓存名称</param>
 /// <param name="function">更新缓存的方法</param>
 /// <param name="args">更新缓存的方法参数</param>
 public static void SetUpdataObjectTiming(TimeSpan timeSpan, string cacheName, Func <Args, object> function, Args args)
 {
     if (CacheObjectData.ContainsKey(cacheName))
     {
         return;
     }
     else
     {
         DataObjectModel dataStringModel = new DataObjectModel();
         dataStringModel.DataObject      = function.Invoke(args);
         dataStringModel.LastRequestTime = DateTime.Now;
         dataStringModel.TimeSpan        = timeSpan;
         dataStringModel.Function        = function;
         dataStringModel.args            = args;
         CacheObjectData.Add(cacheName, dataStringModel);
     }
 }