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); }
public UserMenu(MenuDefinition menuDefinition) { Name = menuDefinition.Name; DisplayName = menuDefinition.DisplayName; Items = new List <UserMenuItem>(); }