public JsonResult CreateDepartmentWithSubject([FromBody] Department dept) { if (ModelState.IsValid) { if (repo.Insert(dept)) { return(Json(new { success = true })); } else { return(Json(new { success = false })); } } else { return(Json(new { success = false })); } //return View(); }