Exemplo n.º 1
0
        /// <summary>
        /// Downloads people list from Azure Storage and stores it locally.
        /// </summary>
        public static async Task <PeopleCollection> DownloadPeopleListAsync()
        {
            PeopleCollection res = null;

            using (var hc = new HttpClient())
            {
                try
                {
                    res = PeopleCollection.FromCsv(await hc.GetStringAsync(_peopleListUrl));
                }
                catch (Exception ex)
                {
                    Debug.WriteLine($"Unable to download people list from URL {_peopleListUrl}.");
                }
            }

            File.WriteAllText(PEOPLE_LIST_PATH, JsonConvert.SerializeObject(res));

            return(res);
        }