Ejemplo n.º 1
0
        public async Task <IHttpActionResult> PutProductModelAsync(int id, ProductCategoryModel productModel)
        {
            var model   = Mapper.Map <ProductCategoryModel, ICategories>(productModel);
            var product = await categoryService.CategoryUpdateAsync(model);

            return(Ok());
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Create([Bind(Include = "ProductId,Name")] ProductCategoryModel productCategoryModel)
        {
            if (ModelState.IsValid)
            {
                var category = Mapper.Map <ProductCategoryModel, ICategories>(productCategoryModel);
                await categoryService.CategoryUpdateAsync(category);

                return(RedirectToAction("Index"));
            }

            return(View(productCategoryModel));
        }