Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var blogsManager = BlogsManager.GetManager();
- var blog = blogsManager.GetBlogs().Single();
- var blogPost = blogsManager.CreateBlogPost();
- blogPost.Parent = blog;
- blogPost.Title = "Test post 2";
- blogPost.Content = "<p>Dad, what's the point of this story?</p><p>I like stories...</p>";
- blogPost.Summary = "Awesome summary";
- blogPost.UrlName = Regex.Replace(blogPost.Title, UrlNameCharsToReplace, UrlNameReplaceString);
- //Publish in future
- var dateToPublish = DateTime.UtcNow.AddMinutes(2);
- blogPost.PublicationDate = dateToPublish;
- blogsManager.Lifecycle.CheckOut(blogPost);
- blogsManager.SaveChanges();
- var bag = new Dictionary<string, string> {
- { "ContentType", typeof(BlogPost).FullName }
- };
- WorkflowManager.MessageWorkflow(blogPost.Id, typeof(BlogPost), null, "Schedule", true, bag);
Advertisement
Add Comment
Please, Sign In to add comment