public async Task <IActionResult> Index() { var Lectures = await _LectureRepository.GetAllLecture(HttpContext.Session.GetInt32("UserId") ?? 1); if (TempData["Error"] != null) { ViewBag.Error = TempData["Error"].ToString(); } if (TempData["Success"] != null) { ViewBag.Success = TempData["Success"].ToString(); } return(View(Lectures)); }