public IActionResult Add(CategoryVM vm) { if (!ModelState.IsValid) { return(BadRequest(ModelState.GetErrorJson())); } else { vm.DoAdd(); if (!ModelState.IsValid) { return(BadRequest(ModelState.GetErrorJson())); } else { return(Ok(vm.Entity)); } } }
public ActionResult Create(CategoryVM vm) { if (!ModelState.IsValid) { return(PartialView(vm)); } else { vm.DoAdd(); if (!ModelState.IsValid) { vm.DoReInit(); return(PartialView(vm)); } else { return(FFResult().CloseDialog().RefreshGrid()); } } }