I m trying to take an RSS feed and deserialize it into a list of rssEntry objects.
var Client = new RestClient("url here");
Request = new RestRequest { RequestFormat DataFormat.Xml };
var response = Client.Execute<Channel>(Request);
return response.Data.Item;
This fills everything in except content which contains CDATA
Channel.cs
public class Channel
{
public string Title { get; set; }
public string Link { get; set; }
public string AtomLink { get; set; }
public string Description { get; set; }
public DateTime LastBuildDate { get; set; }
public string Generator { get; set; }
public string Language { get; set; }
public string UpdatePeriod { get; set; }
public int UpdateFrequency { get; set; }
public RssItems Item { get; set; }
}
Item.cs
public class Item
{
public string Title { get; set; }
public string Link { get; set; }
public string Comments { get; set; }
public DateTime PubDate { get; set; }
public string Creator { get; set; }
public string Category { get; set; }
public string Description { get; set; }
public string Content { get; set; }
public string Guid { get; set; }
public string CommentRss { get; set; }
public int SlashComments { get; set; }
}
I m open to using something other than RestSharp, but I was trying it out for this hoping it would be a nice easy solution.
Currently any field with CDATA is returned as null.