public ActionResult Index1(String musicInfoFrom, string currentFilter, int?page) { var music1 = (from p in db.Music1 select p).OrderByDescending(p => p.music_time).Take(5); var list = (from l in db.List select l).ToList().Take(5); var index = new Music.UI.ViewModel.MusicViewModel() { Musics = music1, List1 = list, }; return(PartialView("Index1", index)); }
public ActionResult Details(int id) { Music1 musics = db.Music1.Find(id); //Pic_Point pp = db.Pic_Point.Find(id); //var picpoint = from p in db.Pic_Point.Where(p => p.Pic_ID == id) // select p; var list = (from l in db.List select l).ToList().Take(5); var music1 = from p in db.Music1.OrderByDescending(p => p.music_time).Take(5) select p; var music_comment = from pc in db.Music_Comment.Where(p => p.music_id == id)/*.OrderByDescending(p => p.music_time)*/ select pc; var index = new Music.UI.ViewModel.MusicViewModel() { Musics = music1, Music2 = musics, List1 = list, Music_Comment = music_comment, }; return(View(index)); }