コード例 #1
0
ファイル: Students.cs プロジェクト: waild/SGMCoreCourse
        public async Task <ActionResult> Create(StudentModel data)
        {
            try
            {
                await coursesRepository.CreateAsync(new Student
                {
                    AverageMark = data.AverageMark,
                    BirthYear   = data.BirthYear,
                    FirstName   = data.FirstName,
                    LastName    = data.LastName,
                    GroupId     = data.GroupId
                });

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }