示例#1
0
        // GET: Musics/Create
        public ActionResult Create(int Id)
        {
            CommentModelsVM commentvm = new CommentModelsVM()
            {
                Comment = new CommentModels(),
                Music   = Id,
            };

            return(View(commentvm));
        }
示例#2
0
        // GET: Comments
        public ActionResult Index(int Id)
        {
            CommentModelsVM vm = new CommentModelsVM()
            {
                Music    = Id,
                Comments = new List <CommentModels>(),
            };

            foreach (var c in db.Comments)
            {
                if (c.Music == Id)
                {
                    vm.Comments.Add(c);
                }
            }
            return(View(vm));
        }