public ActionResult Edit(Guid id) { Post p = postBLL.Get(id); PostVM postVM = new PostVM(); postVM.ID = p.ID; postVM.ImageContent = p.ContentImage.Base64; postVM.TextContent = p.TextContent; return(View(postVM)); }
public void AddComment(CommentVM c) { Comment newC = new Comment(); newC.ID = Guid.NewGuid(); newC.TextContent = c.TextContent; newC.PostID = c.PostID; newC.UserID = new Guid(HttpContext.User.Identity.Name); commentBLL.Add(newC); if (postBLL.Get(c.PostID) != null) { postBLL.Get(c.PostID).Comments.Add(newC); } }