Ejemplo n.º 1
0
        public ActionResult Index()
        {
            IndexViewModel model      = new IndexViewModel();
            var            _videoRepo = new VideoRepository();

            SqlCommand command = new SqlCommand()
            {
                CommandText = "spGetMostViewedVideos",
                CommandType = CommandType.StoredProcedure
            };

            model.MostViewed = _videoRepo.GetVideoList(command);

            command.CommandText = "spGetRecentUploads";
            model.RecentUploads = _videoRepo.GetVideoList(command);

            model.MostLiked = _videoRepo.GetMostLiked(4);

            return(View(model));
        }