예제 #1
0
        public async Task <IActionResult> GetCoursesToChoose(string error = "")
        {
            var id = HttpContext.User.Claims
                     .FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier).Value;
            var idGuid       = Guid.Parse(id);
            var repoResponse = await _repo.LoadCoursesToChoose(idGuid);

            if (!repoResponse.IsSuccess)
            {
                ViewBag.Error = repoResponse.Message;
                return(View("Choose"));
            }

            ViewBag.Courses = repoResponse.Content;
            ViewBag.Error   = error;
            return(View("Choose"));
        }