public async Task <GetMenuItemForEditOutput> GetForEditAsync(NullableIdDto <int> input, int?parentId)
        {
            GetMenuItemForEditOutput output    = new GetMenuItemForEditOutput();
            List <MenuItem>          menuItems = await _menuItemManager.GetMenuItemsAsync();

            output.MenuItems = _mapper.Map <List <MenuItemSelectListDto> >(menuItems);
            if (input.Id.HasValue)
            {
                MenuItemCacheItem menuItem = await _menuItemCache.GetAsync(input.Id.Value) ??
                                             throw new UserFriendlyException("菜单不存在");

                foreach (MenuItemSelectListDto item in output.MenuItems)
                {
                    if (item.Id == menuItem.ParentId)
                    {
                        item.IsSelected = true;
                        break;
                    }
                }
                output.MenuItem = _mapper.Map <MenuItemEditDto>(menuItem);
            }
            else
            {
                output.MenuItem = new MenuItemEditDto();
                if (parentId.HasValue)
                {
                    output.MenuItem.ParentId = parentId;
                }
            }

            return(output);
        }