Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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);
            }
        }