Beispiel #1
0
        /// <summary>
        /// 更新导航
        /// </summary>
        /// <param name="presentAreaNavigation">PresentAreaNavigation</param>
        public void UpdatePresentAreaNavigation(PresentAreaNavigation presentAreaNavigation)
        {
            if (presentAreaNavigation == null)
            {
                return;
            }

            EventBus <PresentAreaNavigation> .Instance().OnBefore(presentAreaNavigation, new CommonEventArgs(EventOperationType.Instance().Update(), presentAreaNavigation.ApplicationId));

            presentAreaNavigationRepository.Update(presentAreaNavigation);
            EventBus <PresentAreaNavigation> .Instance().OnAfter(presentAreaNavigation, new CommonEventArgs(EventOperationType.Instance().Update(), presentAreaNavigation.ApplicationId));

            EntityData.ForType(typeof(PresentAreaNavigation)).RealTimeCacheHelper.IncreaseAreaVersion("OwnerId", presentAreaNavigation.OwnerId);
            EntityData.ForType(typeof(Navigation)).RealTimeCacheHelper.IncreaseAreaVersion("OwnerId", presentAreaNavigation.OwnerId);
        }
Beispiel #2
0
        /// <summary>
        /// 更新导航
        /// </summary>
        /// <param name="presentAreaNavigation">PresentAreaNavigation</param>
        public void UpdatePresentAreaNavigation(PresentAreaNavigation presentAreaNavigation)
        {
            if (presentAreaNavigation == null)
            {
                return;
            }

            EventBus <PresentAreaNavigation> .Instance().OnBefore(presentAreaNavigation, new CommonEventArgs(EventOperationType.Instance().Update(), presentAreaNavigation.ApplicationId));

            presentAreaNavigationRepository.Update(presentAreaNavigation);
            EventBus <PresentAreaNavigation> .Instance().OnAfter(presentAreaNavigation, new CommonEventArgs(EventOperationType.Instance().Update(), presentAreaNavigation.ApplicationId));

            //移除缓存(分布式缓存情况下,本机缓存会有一定延迟)
            string        cacheKey     = GetCacheKey_NavigationOfPresentAreaOwner(presentAreaNavigation.PresentAreaKey, presentAreaNavigation.OwnerId);
            ICacheService cacheService = DIContainer.Resolve <ICacheService>();

            cacheService.Remove(cacheKey);
        }