public void DelMenusModel(long id) { var isParent = _sysMenusRepository.GetAll().Where(w => w.ParentID == id); if (isParent.Any()) { throw new UserFriendlyException("删除菜单失败", "请先删除当前菜单的子菜单!"); } // _sysMenuActionRepository.DelMenusAction(id); // _sysMenusRepository.Delete(id); //清除模块缓存 _cacheManagerExtens.RemoveMenuActionPermissionCache(); }
public void DelMenusModel(long id) { var isParent = _sysMenusRepository.GetAll().Where(w => w.ParentID == id); if (isParent.Any()) { throw new UserFriendlyException("删除菜单失败", "请先删除当前菜单的子菜单!"); } //删除模块明细 _sysMenuActionRepository.DelMenusAction(id); //删除模块 _sysMenusRepository.Delete(id); //提交操作后在进行缓存刷新 _unitOfWorkManager.Current.SaveChanges(); //清除模块缓存 _cacheManagerExtens.RemoveMenuActionPermissionCache(); //重置初始菜单以及授权 _navigationMenusExt.UpNavigationMenusProvider(); }