public IViewComponentResult Invoke(string currentManufacturerId) { if (_catalogSettings.ManufacturersBlockItemsToDisplay == 0) { return(Content("")); } var model = _catalogViewModelService.PrepareManufacturerNavigation(currentManufacturerId); if (!model.Manufacturers.Any()) { return(Content("")); } return(View(model)); }
public async Task <IViewComponentResult> InvokeAsync(string currentManufacturerId) { if (_catalogSettings.ManufacturersBlockItemsToDisplay == 0) { return(Content("")); } var model = await Task.Run(() => _catalogViewModelService.PrepareManufacturerNavigation(currentManufacturerId)); if (!model.Manufacturers.Any()) { return(Content("")); } return(View(model)); }