Esempio n. 1
0
        public async Task <List <User> > GetToDoUserList()
        {
            HttpResponseMessage response = await ApiMessage.Get(null, _appsettings.ToDoApiSettings.ToDoUsers, _httpClient);

            if (response.StatusCode == System.Net.HttpStatusCode.OK)
            {
                var responseBody = await response.Content.ReadAsStringAsync();

                var returnedToDoItems = JsonConvert.DeserializeObject <List <User> >(responseBody);
                return(await Task.FromResult(returnedToDoItems));
            }
            else
            {
                return(new List <User>());
            }
        }