예제 #1
0
        public ActionResult EditingInline_Create([DataSourceRequest] DataSourceRequest request, ProductViewModel product)
        {
            if (product != null && ModelState.IsValid)
            {
                _db.Products.Add(product.ConvertToDomainModel());
                _db.SaveChanges();
            }

            return(Json(new[] { product }.ToDataSourceResult(request, ModelState)));
        }