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")); }
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) }); }