public IActionResult Add(ProductFormVM model) { if (!ModelState.IsValid) { return(View(model)); } model.Product.Thumb = UploadFile(model.Product.file); productOperations.Create(model.Product); return(RedirectToAction(nameof(ProductList))); }
public IActionResult AddProduct(Product product) { var response = _productOperations.Create(product); return(Ok(response)); }