using ReportingServices.ReportingObjects; using System.Text.Json; namespace ReportingServices.Dependency_Injections { public class FabTimeReportingRepository : IFabTimeReportingRepository { public async Task> GetMovesTrendData(string url) { return await GetJsonData>(url); } public async Task> GetToolStateTrendData(string url) { return await GetJsonData>(url); } public async Task> GetToolStateData(string url) { return await GetJsonData>(url); } public async Task GetJsonData(string url) { T deserializedJson; using (var client = new HttpClient()) { using (HttpResponseMessage response = await client.GetAsync(url)) { string apiResponse = await response.Content.ReadAsStringAsync(); deserializedJson = JsonSerializer.Deserialize(apiResponse); } } return deserializedJson; } } }