public ActionResult View(int id) { var model = new ViewVideoViewModel(); if (id != 0) { _videoRepo.AddView(id); model.Video = _videoRepo.GetVideo(id, true); SqlCommand command = new SqlCommand() { CommandText = "spGetUserVideos", CommandType = CommandType.StoredProcedure }; command.Parameters.AddWithValue("@id", model.Video.User.UserID); model.VideoList = _videoRepo.GetVideoList(command); } return(View(model)); }