public async Task <IActionResult> AddSubjectCategory(SubjectCategoryBindingModel subjectCategoryBindingModel) { if (!ModelState.IsValid) { return(RedirectToAction("Index")); } var subjectCategoryModel = new SubjectCategoryModel { Description = subjectCategoryBindingModel.Description }; var successful = await _subjectCategoryService.AddSubjectCategoryAsync(subjectCategoryModel); if (!successful) { return(BadRequest("Could not add the subject category")); } return(RedirectToAction("Index")); }
public IActionResult AddSubjectCategory() { var bindingModel = new SubjectCategoryBindingModel(); return(View(bindingModel)); }