Example #1
0
        public virtual async Task OnGetAsync()
        {
            var product = await _productAppService.GetAsync(ProductId);

            ProductSku =
                ObjectMapper.Map <ProductSkuDto, EditProductSkuViewModel>(
                    product.ProductSkus.Single(x => x.Id == ProductSkuId));
        }
Example #2
0
        public virtual async Task OnGetAsync()
        {
            var product = await _productAppService.GetAsync(ProductId);

            var sku = product.ProductSkus.Single(x => x.Id == ProductSkuId);

            ProductSku = ObjectMapper.Map <ProductSkuDto, EditProductSkuViewModel>(sku);

            if (sku.ProductDetailId.HasValue)
            {
                var detailDto = await _productDetailAppService.GetAsync(sku.ProductDetailId.Value);

                ProductSku.ProductDetail = new CreateEditSkuProductDetailViewModel
                {
                    StoreId     = detailDto.StoreId,
                    Description = detailDto.Description
                };
            }
        }