コード例 #1
0
        public async Task <IActionResult> Register(CourseCreateInput inputCourse)
        {
            var coursenew = await _courseAppService.CreateCourse(inputCourse);

            var output = await _courseAppService.GetCoursesList();

            output.Add(coursenew);
            output.OrderByDescending(t => t.CreationTime);
            return(View("CourseList", output));
        }
コード例 #2
0
        public async Task <ActionResult> SelectCourseCreate()
        {
            if (!HttpContext.User.Identity.IsAuthenticated)
            {
                return(View("../Home/Login"));
            }
            else
            {
                var personId = HttpContext.User.Claims.First().Value;
                var person   = await _personAppService.GetPersonByUserId(personId);

                var courseList = await _courseAppService.GetCoursesList();

                ViewData["person"]     = person.Name;
                ViewData["personId"]   = person.UserId;
                ViewData["courseList"] = courseList;
                return(View());
            }
        }