Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }