public static RecommentBlogger Load(XElement element,int index ) { if (element == null) throw new ArgumentNullException("element"); RecommentBlogger blogger = new RecommentBlogger(); blogger.Index = index; blogger.Id = element.Element("id")?.Value; blogger.Name = element.Element("title")?.Value; blogger.Updated = Convert.ToDateTime(element?.Element("updated")?.Value); blogger.BloggerHome = element?.Element("link")?.Attribute("href")?.Value; blogger.BlogApp = element.Element("blogapp")?.Value; blogger.Avatar = element?.Element("avatar")?.Value; if (blogger.Avatar.IsNullOrEmpty()) blogger.Avatar = Configuration.DefalutImagePath; blogger.PostCount = Convert.ToInt32(element?.Element("postcount")?.Value); return blogger; }
public static RecommentBlogger Load(XElement element, int index) { if (element == null) { throw new ArgumentNullException("element"); } RecommentBlogger blogger = new RecommentBlogger(); blogger.Index = index; blogger.Id = element.Element("id")?.Value; blogger.Name = element.Element("title")?.Value; blogger.Updated = Convert.ToDateTime(element?.Element("updated")?.Value); blogger.BloggerHome = element?.Element("link")?.Attribute("href")?.Value; blogger.BlogApp = element.Element("blogapp")?.Value; blogger.Avatar = element?.Element("avatar")?.Value; if (blogger.Avatar.IsNullOrEmpty()) { blogger.Avatar = Configuration.DefalutImagePath; } blogger.PostCount = Convert.ToInt32(element?.Element("postcount")?.Value); return(blogger); }