public IActionResult Get() { var result = examManager.ListExams(); if (result.status) { return(Ok(result.Data)); } else { return(BadRequest(result.message)); } }
// GET: Exam public ActionResult Index() { var result = _exam.ListExams(); if (result.status) { return(View(result.Data)); } else { ViewBag.ErrorMessage = result.message; return(View("Error")); } }