Example #1
0
 /// <summary>
 /// <entry>
 ///   <id>3454999</id>
 ///   <title type = "text" />
 ///   < published > 2016 - 06 - 19T16:01:42+08:00</published>
 ///   <updated>2016-06-19T09:04:55Z</updated>
 ///   <author>
 ///       <name>*平*</name>
 ///       <uri>http://home.CnBlogs.com/u/980309/</uri>
 ///   </author>
 ///   <content type = "text" > 一直使用7z,但没用过命令行,长知识了,感谢楼主分享。</content>
 /// </entry>
 /// 
 /// </summary>
 /// <param name="element"></param>
 /// <returns></returns>
 public static BlogComment Load(XElement element,int floorNumber)
 {
     if (element == null) throw new ArgumentNullException("element");
     BlogComment blogComment = new BlogComment();
     blogComment.Id = element?.Element("id").Value;
     blogComment.Published = Convert.ToDateTime(element?.Element("published").Value);
     blogComment.Updated = Convert.ToDateTime(element?.Element("updated").Value);
     blogComment.Author = Author.Load(element?.Element("author"));
     blogComment.Content = element?.Element("content").Value;
     blogComment.FloorNumber = floorNumber;
     return blogComment;
 }