Ejemplo n.º 1
0
        public async Task<ActionResult> Edit(Product product)
        {
            if (ModelState.IsValid)
            {
                await documentService.UpdateAsync(productMapper.MapFrom(product));
                return View("Complete", product);
            }

            return View(product);
        }
Ejemplo n.º 2
0
 public ProductInfo MapFrom(Product product)
 {
     return new ProductInfo
     {
         ProductId = product.ProductId.ToString(CultureInfo.InvariantCulture),
         Name = product.Name,
         Description = product.Description,
         Category = product.Category,
         Color = product.Color,
         ListPrice = product.ListPrice.ToString(CultureInfo.InvariantCulture),
         ProductModel = product.ProductModel,
         ProductNumber = product.ProductNumber,
         Subcategory = product.Subcategory
     };
 }