示例#1
0
 public PartialViewResult _CommentsForPhoto(Comment comment, int PhotoId)
 {
     comment.UserName = "******";
     context.Add<Comment>(comment);
     context.SaveChanges();
     var comments = from c in context.Comments
                    where c.PhotoID == PhotoId
                    select c;
     ViewBag.PhotoId = PhotoId;
     return PartialView("_CommentsForPhoto", comments.ToList());
 }
示例#2
0
        public PartialViewResult _Create(int PhotoId)
        {
            Comment newComment = new Comment();
            newComment.PhotoID = PhotoId;

            ViewBag.PhotoID = PhotoId;
            return PartialView("_CreateAComment");
        }