예제 #1
0
        /// <summary>
        /// <c>Index</c> is a method in the <c>HomeController</c>.
        /// It post articles on the page from DB.
        /// </summary>
        public ViewResult Index()
        {
            ArticleR articleR = new ArticleR();

            ViewBag.Articles = articleR.GetAll();
            return(View());
        }
예제 #2
0
        public ViewResult GetArticles(string h)
        {
            ArticleR articleR = new ArticleR();
            var      temp     = articleR.GetAll();
            var      art      = temp.Where(a => a.Text.Contains(h));

            ViewBag.Articles = art;
            return(View("Index"));
        }