public async Task> RequestAsync() { using HttpClient client = new HttpClient(); string content = ""; HttpResponseMessage response = await client.GetAsync(_url); if (response.IsSuccessStatusCode) { content = await response.Content.ReadAsStringAsync(); } List devices = JsonSerializer.Deserialize>(content); return devices; } public List GetDummyData(int lokatieId) { DatabaseConnection testConnection = new DatabaseConnection("multipass_test"); List devIds = testConnection.ExecuteSQLCommand("SELECT DevID FROM devices WHERE Lokatie=" + lokatieId); List lastAccessDate = testConnection.ExecuteSQLCommand("SELECT lastAccessDate FROM devices WHERE Lokatie=" + lokatieId); List lastAccessTime = testConnection.ExecuteSQLCommand("SELECT lastAccessTime FROM devices WHERE Lokatie=" + lokatieId); List dummyData = new List(); for (int i = 0; i < devIds.Count; i++) { dummyData.Add(new DeviceTest(DateTime.Parse(lastAccessDate[i] + " " + lastAccessTime[i]), devIds[i])); } return dummyData; } public void GenerateJSON(List list) { string json = JsonSerializer.Serialize(list); File.WriteAllText(@"C:\Users\werkplaats\Downloads\" + "test" + ".json", json); } public List GetJSONData() { string path = @"C:\Users\werkplaats\Downloads\" + _url.Split("/")[2]; List devices = new List(); if (!File.Exists(path)) { using (StreamReader sr = File.OpenText(path + ".json")) { devices = JsonSerializer.Deserialize>(sr.ReadLine()); } } return devices; }