using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MyWebSite.Models;

namespace MyWebSite.Controllers
{
    public class HomeController : Controller
    {

        private MyWebSiteEntities _db = new MyWebSiteEntities();

        public ActionResult Index()
        {
            var list = (from a in _db.Articles
                        where a.Status.Equals(1)
                        orderby a.Published descending
                        select a).Take(2);

            return View(list);
        }
    }
}
