public ActionResult <ProductDetailDto> CreateProductDetail([FromBody] ProductDetailDto productdetail)
        {
            productdetail.SizeId    = productdetail.Size.Id;
            productdetail.Size      = null;
            productdetail.ColorId   = productdetail.Color.Id;
            productdetail.Color     = null;
            productdetail.ProductId = productdetail.Product.Id;
            productdetail.Product   = null;

            var productdetailDto = _productdetailService.CreateProductDetail(productdetail);

            if (productdetailDto == null)
            {
                List <string> errorMessage = new List <string>();
                errorMessage.Add("Đã phát sinh lỗi, vui lòng thử lại");
                return(BadRequest(new ResponseDto(errorMessage, 500, productdetailDto)));
            }

            List <string> successMessage = new List <string>();

            successMessage.Add("Thêm thông tin thành công");
            var responseDto = new ResponseDto(successMessage, 200, productdetailDto);

            return(Ok(responseDto));
        }
        public ActionResult CreateNewProductDetail(ProductDetailModel productDetailModel)
        {
            if (productDetailModel.IconFile == null || productDetailModel.Files == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            if (ModelState.IsValid)
            {
                _productDetailService.CreateProductDetail(productDetailModel);
                return(Json(new { data = "success" }, JsonRequestBehavior.AllowGet));
            }
            return(View());
        }