Skip to content

Instantly share code, notes, and snippets.

@biac
Created Dec 6, 2011
Embed
What would you like to do?
FeedReader: ToFeedData() 拡張メソッド
public static class SyndicationFeedExtensions
{
public static FeedData ToFeedData(this SyndicationFeed feed)
{
FeedData feedData = new FeedData(){
Title = feed.Title.Text,
};
foreach (SyndicationItem item in feed.Items) {
feedData.Items.Add(CreateFeedItem(item));
}
return feedData;
}
private static FeedItem CreateFeedItem(SyndicationItem item) {
return new FeedItem(){
Title = item.Title.Text,
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment