Exemplo n.º 1
0
 private static Comment CreateComment(Post post)
 {
     return new Comment
         {
             CommentId = Guid.NewGuid(),
             Content = "这是评论的内容.",
             Author="guest",
             Post = post,
         };
 }
Exemplo n.º 2
0
Arquivo: Rss.cs Projeto: 441023065/CMS
        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;
        }
Exemplo n.º 3
0
Arquivo: Rss.cs Projeto: joargp/CMS
 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()}
     };
 }