コード例 #1
0
        public string GetApplicationCacheValueForEdit(string Key)
        {
            List <ApplicationCache> applicationCaches = new List <ApplicationCache>();
            ApplicationCache        applicationCache  = new ApplicationCache();
            // List<ApplicationCacheViewModel> applicationCacheViewModel = new List<ApplicationCacheViewModel>();

            ApplicationCacheViewModel applicationCacheViewModel = new ApplicationCacheViewModel();

            applicationCaches = this._ICacheOrchestrator.GetAllApplicationCacheConfig();

            applicationCache = applicationCaches.AsParallel().Where(x => x.Key.ToLower() == Key.ToLower()).FirstOrDefault();

            Mapper.Map(applicationCache, applicationCacheViewModel);

            //string ret = RenderPartialToString("~/Areas/Management/Views/CacheManage/_GetAppCacheValueForEdit", applicationCacheViewModel);
            string ret = RenderPartialToString("_GetAppCacheValueForEdit", applicationCacheViewModel, ControllerContext);


            return(ret);
        }
コード例 #2
0
        public ActionResult UpdateApplicationCacheValue(ApplicationCacheViewModel applicationCacheViewModel)
        {
            ApplicationCache applicationCache = new ApplicationCache();

            Mapper.Map(applicationCacheViewModel, applicationCache);
            DatabaseModel databaseReturnInfoModel = new DatabaseModel();

            databaseReturnInfoModel.UserId = this.GetUserId().Value;
            databaseReturnInfoModel        = this._ICacheOrchestrator.UpdateApplicationCacheValue(applicationCache, databaseReturnInfoModel);

            if (databaseReturnInfoModel.ReturnError == 0)
            {
                GlobalCachingProvider.Instance.RefreshApplicationCacheItems();

                return(Content("UpdateApplicationCacheValueSuccess"));
            }
            else
            {
                return(Content("UpdateApplicationCacheValueFailed"));
            }
        }