public IEnumerable <DataSearchModel> GetCategories() { var response = _nopService.GetCategories(); var data = response.Categories.Select(c => new DataSearchModel() { Label = c.Name, Value = c.Id }); return(data); }
public IEnumerable <DataSearchModel> GetCategories() { var storeId = GlobalSettings.UmbracoSettings.NopStoreId; var isGetProductLimitToStore = GlobalSettings.UmbracoSettings.GetProductLimitToStore; var response = _nopService.GetCategories(); var categories = storeId != 0 && isGetProductLimitToStore?response.Categories.Where(category => category.StoreIds.Contains(storeId)).ToList() : response.Categories; var data = categories.Select(c => new DataSearchModel() { Label = c.Name, Value = c.Id }); return(data); }