public IActionResult Create([FromQuery] string courseName, int courseId) { var model = new SemesterCreateInputModel { CourseName = courseName, CourseId = courseId, }; return(this.View(model)); }
public async Task <IActionResult> Create([FromQuery] string courseName, int courseId, SemesterCreateInputModel input) { if (!this.ModelState.IsValid) { return(this.View(input)); } await this.semestersService.CreateAsync(input.Number, input.Year, courseName, courseId); return(this.RedirectToAction("ByName", "Courses", new { courseName })); }