public void SetRemoveCurrentNavigationCache() { Web.Common.Helper.InMemoryCache cacheFunc = new Web.Common.Helper.InMemoryCache(); string currNavigationKey = CurrentRole.Name + CurrentRole.ID; List <CMSNavigation> cachedsharingskey = cacheFunc.GET <List <CMSNavigation> >(currNavigationKey); if (cachedsharingskey != null) { cacheFunc.REMOVE(currNavigationKey); } SetCurrentNavigationCache(); }
public void SetRemoveCurrentAllowedControllerActionCache() { Web.Common.Helper.InMemoryCache cacheFunc = new Web.Common.Helper.InMemoryCache(); string currNavigationKey = "_ALLOWEDCONTROLLER_" + CurrentRole.Name + CurrentRole.ID; List <CMSNavigation> cachedsharingskey = cacheFunc.GET <List <CMSNavigation> >(currNavigationKey); if (cachedsharingskey != null) { cacheFunc.REMOVE(currNavigationKey); } SetCurrentAllowedControllerActionCache(); }
public List <CMSNavigation> SetCurrentNavigationCache() { List <CMSNavigation> navigations = new List <CMSNavigation>(); string currNavigationKey = string.Format("{0}-{1}", CurrentRole.ID, CurrentRole.Name); List <CMSNavigation> cachedsharingskey = new Web.Common.Helper.InMemoryCache().GET <List <CMSNavigation> >(currNavigationKey); if (cachedsharingskey != null) { navigations = cachedsharingskey; } else { navigations = CurrentNavigation; new Web.Common.Helper.InMemoryCache().SET <dynamic>(currNavigationKey, () => navigations); } return(navigations); }
public List <UserAccessModel> SetCurrentAllowedControllerActionCache() { List <UserAccessModel> AllowedControllerAction = new List <UserAccessModel>(); string currNavigationKey = "_ALLOWEDCONTROLLER_" + CurrentRole.Name + CurrentRole.ID; List <UserAccessModel> cachedsharingskey = new Web.Common.Helper.InMemoryCache().GET <List <UserAccessModel> >(currNavigationKey); if (cachedsharingskey != null) { AllowedControllerAction = cachedsharingskey; } else { AllowedControllerAction = GetAllowedControllerAction; new Web.Common.Helper.InMemoryCache().SET <List <UserAccessModel> >(currNavigationKey, () => AllowedControllerAction); } return(AllowedControllerAction); }