コード例 #1
0
ファイル: EditModal.cshtml.cs プロジェクト: xingx001/EShop
        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;
        }
コード例 #2
0
 public Task <PagedResultDto <ProductCategoryDto> > GetListAsync(GetProductCategoryListDto input)
 {
     return(_service.GetListAsync(input));
 }