コード例 #1
0
        //GET: /Article/Show/{id}    <==== one article
        public ActionResult Show(int id)
        {
            ArticleDataController Controller = new ArticleDataController();


            Article SelectedArticle = Controller.FindArticle(id);

            return(View(SelectedArticle));
        }
コード例 #2
0
        //GET: /Article/List   <====== many articles

        public ActionResult List(string ArticleSearchKey)
        {
            //need to add using System Diagnostics to use this debug line
            Debug.WriteLine("The search is " + ArticleSearchKey);

            ArticleDataController Controller = new ArticleDataController();


            IEnumerable <Article> Articles = Controller.ListArticles(ArticleSearchKey);

            return(View(Articles));
        }