public async Task <List <int> > getListMenuItemId(List <int> listMenuItemId, int menuItemId, CancellationToken cancellationToken) { var menuItem = await _menuItemRepository.Get(menuItemId, cancellationToken); if (menuItem != null) { listMenuItemId.Add(menuItemId); var childrens = await _menuItemRepository.GetChildrens(menuItemId, cancellationToken); foreach (var item in childrens) { await getListMenuItemId(listMenuItemId, item.Id, cancellationToken); } } return(listMenuItemId); }