示例#1
0
        public ActionResult AddComment(Guid id, string albumComment)
        {
            //var p = albums.FirstOrDefault(x => x.AlbumID == id);
            //p.AlbumComment.Add(new Comments { CommentOnAlbum = albumComment });
            var album  = albumrepo.AddCommentToAlbum(id, albumComment);
            var albums = AlbumModelMapper.ModelToEntity(album);

            return(PartialView("IndexPartial", albums));
        }
示例#2
0
        public ActionResult Index(AlbumModel album, string albumComment)
        {
            //todo: fix commenting on albums
            CommentModel newAlbumComment = new CommentModel()
            {
                Comment     = albumComment,
                DateCreated = DateTime.Now,
                Album       = album,
            };

            AlbumRepository.AddCommentToAlbum(album.Id, newAlbumComment);

            return(View(AlbumRepository._albums));
        }