Esempio n. 1
0
 private static KeyConfigFormatObjcet GetFormatObjcetDict(CacheKeyConfig keyConfig)
 {
     if (keyConfig == null)
     {
         throw new InkeyException(InkeyErrorCodes.CommonFailure, "缓存配置获取失败");
     }
     if (string.IsNullOrEmpty(keyConfig.ProjectName))
     {
         if (string.IsNullOrEmpty(AppInfo.AppCode))
         {
             throw new InkeyException(InkeyErrorCodes.CommonFailure, "缓存配置项目名称参数缺失");
         }
         keyConfig.ProjectName = AppInfo.AppCode;
     }
     if (string.IsNullOrEmpty(keyConfig.ProjectShowName))
     {
         if (string.IsNullOrEmpty(AppInfo.AppName))
         {
             throw new InkeyException(InkeyErrorCodes.CommonFailure, "缓存配置项目名称参数缺失");
         }
         keyConfig.ProjectShowName = AppInfo.AppName;
     }
     return(new KeyConfigFormatObjcet(keyConfig.ProjectName, keyConfig.CacheKeys, keyConfig.CacheValueTypes));
 }
Esempio n. 2
0
        public static KeyConfigFormatObjcet GetFormatObjcetDictFromAssembly(Assembly assembly)
        {
            CacheKeyConfig keysConfig = GetKeyConfigFormAssembly(assembly);

            return(GetFormatObjcetDict(keysConfig));
        }
Esempio n. 3
0
 public static KeyConfigFormatObjcet GetFormatObjcetDictFromConfig(CacheKeyConfig keysConfig)
 {
     return(GetFormatObjcetDict(keysConfig));
 }