public ActionResult Index() { List <ThreadDO> threadList = _threadDataAccess.ViewAllThreads(); List <ThreadPO> displayList = ThreadMapper.ListDOToPO(threadList); ThreadViewModel viewModel = new ThreadViewModel(); if (Session["Username"] != null) { //views a list of all threads viewModel.AverageWords = AverageWordsPerPost(); viewModel.Threads = displayList; } else { TempData["message"] = "Must be logged in to view that page."; } return(View(viewModel)); }