public async Task <UserMenu> GetMenuAsync(string menuName, ClaimsPrincipal user)
        {
            MenuDefinition menuDefinition = _navigationManager.Menus.GetOrDefault(menuName);

            if (menuDefinition == null)
            {
                throw new Exception("Нет меню с именем:" + menuName);
            }
            var userMenu = new UserMenu(menuDefinition);

            await FillUserMenuItems(user, menuDefinition.Items, userMenu.Items);

            return(userMenu);
        }
예제 #2
0
 public UserMenu(MenuDefinition menuDefinition)
 {
     Name        = menuDefinition.Name;
     DisplayName = menuDefinition.DisplayName;
     Items       = new List <UserMenuItem>();
 }