コード例 #1
0
        public IActionResult GetAllThreads()
        {
            List <Thread> threadList = threadRepo.GetThreads();

            if (threadList.Count != 0 && threadList != null)
            {
                return(Ok(threadList));
            }
            else
            {
                return(NotFound());
            }
        }
コード例 #2
0
ファイル: HomeController.cs プロジェクト: bryantb2/CS295N
        public IActionResult Index(int category = -1)
        {
            // Get thread objects
            // check if search results have already been queued
            // Pass thread list into Home
            List <Thread> threadList;

            if (category != -1)
            {
                threadList = threadRepo.GetCategoryOfThreads(category);
            }
            else
            {
                threadList = threadRepo.GetThreads();
            }
            return(View("Home", threadList));
        }