public IActionResult UpdateSubject([FromBody] SubjectModel model) { model.SkipSemesterIdValidation(ModelState); if (ModelState.IsValid) { string errorMessage = string.Empty; if (service.UpdateSubject(model, ref errorMessage)) { return(Json(new Result(true))); } return(Json(new Result(errorMessage))); } return(Json(new Result(ModelState.GetFirstError()))); }