Created
December 6, 2011 08:06
-
-
Save biac/1437316 to your computer and use it in GitHub Desktop.
FeedReader: 最初の実装
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<FeedData> ReadAsync(string feedUrlString) | |
{ | |
Uri feedUri = new Uri(feedUrlString); | |
return await ReadAsync(feedUri); | |
} | |
private async Task<FeedData> ReadAsync(Uri feedUri) | |
{ | |
SyndicationClient client = new SyndicationClient() { BypassCacheOnRetrieve = true }; | |
SyndicationFeed feed = await client.RetrieveFeedAsync(feedUri); //※ | |
return feed.ToFeedData(); // ← return 文では FeedData 型を返しているつもり。 | |
// async キーワードで勝手に Task<T> にラップしてくれる。 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment