public IActionResult Edit(int id, edit_product_viewmodel model)
        {
            if (id != model.Id)
            {
                return(RedirectToAction("Index"));
            }

            if (ModelState.IsValid)
            {
                try
                {
                    if (model.photo != null)
                    {
                        Upload_photo(model.photo);
                    }
                    Product product = new Product {
                        Id = model.Id, Name = model.Name, Category = model.Category, photo = model.photo.FileName, Price = model.Price, ShopID = UserManager.GetUserId(HttpContext.User)
                    };
                    _Iproduct.Editproduct(product);
                }
                catch
                {
                    //return RedirectToAction("Index");
                    return(NotFound());
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(RedirectToAction(nameof(Index)));
        }
        // GET: Products/Edit/5
        public IActionResult Edit(int id)
        {
            var product = _Iproduct.GetProduct(id);

            if (product == null)
            {
                return(NotFound());
            }
            edit_product_viewmodel edit = new edit_product_viewmodel {
                Id = product.Id, Name = product.Name, Price = product.Price, exist_photo_path = product.photo
            };


            return(View(edit));
        }