diff options
author | Aryadev Chavali <aryadevchavali1@gmail.com> | 2019-02-03 23:44:35 +0000 |
---|---|---|
committer | Aryadev Chavali <aryadevchavali1@gmail.com> | 2019-02-03 23:44:35 +0000 |
commit | d18b5e9f7c90bf8b24146cff2eabf605889b4e38 (patch) | |
tree | a650d852fa855929e5e8416496d811c83a61a356 /Aggregator/Parser/Download.cs | |
parent | f1c584a0189213622976cded0bbb33359ba9a19d (diff) | |
download | newsaggregator-d18b5e9f7c90bf8b24146cff2eabf605889b4e38.tar.gz newsaggregator-d18b5e9f7c90bf8b24146cff2eabf605889b4e38.tar.bz2 newsaggregator-d18b5e9f7c90bf8b24146cff2eabf605889b4e38.zip |
Added comments
Diffstat (limited to 'Aggregator/Parser/Download.cs')
-rw-r--r-- | Aggregator/Parser/Download.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Aggregator/Parser/Download.cs b/Aggregator/Parser/Download.cs index c90dc0a..eb46dd0 100644 --- a/Aggregator/Parser/Download.cs +++ b/Aggregator/Parser/Download.cs @@ -3,14 +3,26 @@ using System.Threading.Tasks; namespace Parser { public static class Download { + /// <summary> + /// Download source from a given site synchronously + /// </summary> + /// <param name="site">Site to download from</param> + /// <returns></returns> public static string DownloadXMLSync(string site) { using (var client = new WebClient()) { return client.DownloadString(site); } } + /// <summary> + /// Download source from a given site asynchronously + /// </summary> + /// <param name="site">Site to download from</param> + /// <returns></returns> public static Task<string> DownloadXML(string site) { using (var client = new WebClient()) { + /* TODO: Find some way to circumvent creating a new WebClient every download + *2019-02-03 23:43*/ return client.DownloadStringTaskAsync(site); } } |