예제 #1
0
        public IActionResult Get()
        {
            var result = examManager.ListExams();

            if (result.status)
            {
                return(Ok(result.Data));
            }
            else
            {
                return(BadRequest(result.message));
            }
        }
예제 #2
0
        // GET: Exam
        public ActionResult Index()
        {
            var result = _exam.ListExams();

            if (result.status)
            {
                return(View(result.Data));
            }
            else
            {
                ViewBag.ErrorMessage = result.message;
                return(View("Error"));
            }
        }