Example #1
0
        public ActionResult CreatePostPartial(Post model)
        {
            AccountBLL account = new AccountBLL(new DAL.UnitOfWork.UnitOfWork(new BlogDBContext()));
            PostBLL    post    = new PostBLL(new DAL.UnitOfWork.UnitOfWork(new BlogDBContext()));

            model.AccountId = account.getByEmail(User.Identity.Name).AccountId;
            model.DatePost  = DateTime.Now;
            post.Add(model);
            //var strContent = form["txtContent"].ToString();//FormCollection form
            return(Redirect("Index"));
        }
Example #2
0
 public void AddPost(PostVM c)
 {
     postBLL.Add(new Post {
         ID           = Guid.NewGuid(),
         TextContent  = c.TextContent,
         ContentImage = new Image {
             ID     = Guid.NewGuid(),
             Base64 = c.ImageContent
         },
         UserID = new Guid(HttpContext.User.Identity.Name)
     });
 }