public ActionResult EditingCustomValidation_Update([DataSourceRequest] DataSourceRequest request, CustomValidationProductViewModel product)
        {
            if (product != null && ModelState.IsValid)
            {
                productService.Update(new ProductViewModel
                {
                    ProductID   = product.ProductID,
                    ProductName = product.ProductName,
                    UnitPrice   = product.UnitPrice
                });
            }

            return(Json(new[] { product }.ToDataSourceResult(request, ModelState)));
        }
        public ActionResult EditingCustomValidation_Update([DataSourceRequest] DataSourceRequest request, CustomValidationProductViewModel product)
        {
            if (product != null && ModelState.IsValid)
            {
                var target = SessionProductRepository.One(p => p.ProductID == product.ProductID);
                if (target != null)
                {
                    target.ProductName = product.ProductName;
                    target.UnitPrice   = product.UnitPrice;
                    SessionProductRepository.Update(target);
                }
            }

            return(Json(ModelState.ToDataSourceResult()));
        }