public virtual async Task OnGetAsync(Guid storeId) { ProductGroups = (await _service.GetProductGroupListAsync()).Items .Select(dto => new SelectListItem(dto.DisplayName, dto.Name)).ToList(); Categories = (await _categoryAppService.GetListAsync(new GetCategoryListDto { MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount }))?.Items .Select(dto => new SelectListItem(dto.DisplayName, dto.Id.ToString())).ToList(); var productDto = await _service.GetAsync(Id, storeId); var detailDto = await _productDetailAppService.GetAsync(productDto.ProductDetailId); Product = ObjectMapper.Map <ProductDto, CreateEditProductViewModel>(productDto); Product.CategoryIds = (await _productCategoryAppService.GetListAsync(new GetProductCategoryListDto { ProductId = productDto.Id, MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount })).Items.Select(x => x.CategoryId).ToList(); Product.ProductDetail = new CreateEditProductDetailViewModel { StoreId = storeId, Description = detailDto.Description }; Product.StoreId = storeId; }
public Task <PagedResultDto <ProductCategoryDto> > GetListAsync(GetProductCategoryListDto input) { return(_service.GetListAsync(input)); }