public IActionResult SaveProduct([FromForm] ProductDto productDto)
 {
     try
     {
         if (productDto == null)
         {
             return(BadRequest());
         }
         Product product = new Product();
         product.Name        = productDto.Name;
         product.Price       = productDto.Price;
         product.Description = productDto.Description;
         bool isSaved = _productService.SaveProduct(product);
         if (isSaved)
         {
             //
             try
             {
                 string directoryPath = _hostingEnv.WebRootPath + "\\uploads\\";
                 if (!Directory.Exists(directoryPath))
                 {
                     Directory.CreateDirectory(directoryPath);
                 }
                 string savePath = directoryPath + productDto.Image.FileName;
                 using (FileStream filestream = System.IO.File.Create(savePath))
                 {
                     productDto.Image.CopyTo(filestream);
                     filestream.Flush();
                 }
                 //
                 Picture picture = new Picture();
                 picture.Name     = productDto.Image.FileName;
                 picture.ImageUrl = "\\uploads\\" + productDto.Image.FileName;
                 //
                 isSaved = _pictureService.SavePicture(picture);
                 if (isSaved)
                 {
                     isSaved = _pictureService.AddProductPicture(product.Id, picture.Id);
                 }
             }
             catch (Exception ex)
             {
             }
         }
         //
         return(Ok(product));
     }
     catch (Exception exp)
     {
         return(BadRequest());
     }
 }