// GET: Home
        public ActionResult Index()
        {
            MovieDBEntities1 db = new MovieDBEntities1();
            var list            = db.Movies.ToList();

            return(View(list));
        }
        public ActionResult Detay(int id)
        {
            MovieDBEntities1 db   = new MovieDBEntities1();
            var        list       = db.Movies.ToList();
            DetayModel detayModel = new DetayModel();
            Movies     movie      = list.Find(x => x.Id == id);

            detayModel.movie = movie;

            detayModel.comments = detayModel.movie.Comments.OrderByDescending(x => x.Id).ToList();
            return(View(detayModel));
        }
        public ActionResult Category(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var        db   = new MovieDBEntities1();
            var        list = db.Categories.ToList();
            Categories cat  = list.Find(x => x.Id == id);

            if (cat == null)
            {
                return(HttpNotFound());
            }

            return(View("Index", cat.Movies.OrderByDescending(x => x.ReleaseDate).ToList()));
        }