private static Comment CreateComment(Post post)
 {
     return new Comment
         {
             CommentId = Guid.NewGuid(),
             Content = "这是评论的内容.",
             Author="guest",
             Post = post,
         };
 }
Exemple #2
0
        private RssItem BuildPostRssItem(Post item)
        {
            var link = string.Format("{0}/#!/post/{1}", Config.URL.Domain, item.Url);

            var rssItem = new RssItem
                              {
                                  Title = item.Title,
                                  Link = new Uri(link),
                                  Description = item.Content,
                                  PubDate = item.PubDate,
                                  //Author = item.PubAdmin.Name, //TODO:ef出错
                                  Guid = new RssGuid {Name = item.PostId.ToString()}
                              };
            foreach (var cat in item.Categorys)
            {
                rssItem.Categories.Add(new RssCategory
                                           {
                                               Name = string.Format("{0} - {1}", item.Group.Name, cat.Name)
                                           });
            }
            return rssItem;
        }
Exemple #3
0
 private RssItem CreatePostItem(Post item)
 {
     return new RssItem
     {
         Title = item.Title,
         Link = new Uri(string.Format("{0}/post/{1}", Config.URL.Domain, item.Url)),
         Description = item.Content,
         PubDate = item.PubDate,
         Author = item.CreateUser,
         Guid = new RssGuid {Name = item.PostId.ToString()}
     };
 }