Esempio n. 1
0
 public async Task <ActionResult <CourseQuiz> > GetQuiz(string courseId)
 {
     try
     {
         if (!string.IsNullOrWhiteSpace(courseId))
         {
             return(Ok(await quizRepo.GetQuizAsync(courseId)));
         }
         else
         {
             return(BadRequest(ModelState));
         }
     }
     catch (Exception ex)
     {
         logger.LogInformation($"Unable to Get course object failed with exception {ex.Message} and " +
                               $"stack trace {ex.StackTrace}");
         return(StatusCode(500, new
         {
             ErroMsg = "Failed to Get CourseQuiz",
             Status = 500
         }));
     }
 }