private void migrateComments(BlogPost blogPost, BlogsManager blogsManager, Entry post, Feed feed)
        {
            BlogPost livePost = blogsManager.GetLive(blogPost);

            foreach (Entry cmmnt in feed.Entry.Where(en => en.Categories.Any(c => c.CategoryType == CategoryType.Comment) && en.ReplyTo != null && en.ReplyTo.Id == post.Id))
            {
                Comment comment = blogsManager.CreateComment(livePost);
                comment.AuthorName = cmmnt.Author.Name;
                comment.Email = cmmnt.Author.Email;
                comment.Content = cmmnt.Content;
                comment.DateCreated = cmmnt.Published;

                blogsManager.SaveChanges();
            }
        }
Esempio n. 2
0
        private void migrateComments(BlogPost blogPost, BlogsManager blogsManager, Entry post, Feed feed)
        {
            BlogPost livePost = blogsManager.GetLive(blogPost);

            foreach (Entry cmmnt in feed.Entry.Where(en => en.Categories.Any(c => c.CategoryType == CategoryType.Comment) && en.ReplyTo != null && en.ReplyTo.Id == post.Id))
            {
                Comment comment = blogsManager.CreateComment(livePost);
                comment.AuthorName  = cmmnt.Author.Name;
                comment.Email       = cmmnt.Author.Email;
                comment.Content     = cmmnt.Content;
                comment.DateCreated = cmmnt.Published;

                blogsManager.SaveChanges();
            }
        }