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()); }
public PartialViewResult _Create(int PhotoId) { Comment newComment = new Comment(); newComment.PhotoID = PhotoId; ViewBag.PhotoID = PhotoId; return PartialView("_CreateAComment"); }