示例#1
0
        public IActionResult Create([FromQuery] string courseName, int courseId)
        {
            var model = new SemesterCreateInputModel
            {
                CourseName = courseName,
                CourseId   = courseId,
            };

            return(this.View(model));
        }
示例#2
0
        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 }));
        }