Ran formatting through code
This commit is contained in:
@ -1,22 +1,19 @@
|
||||
using ReportingServices.Shared.Models.ProductionReport;
|
||||
using System.Net.Http.Json;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace ReportingServices.Shared.HelperClasses
|
||||
namespace ReportingServices.Shared.HelperClasses;
|
||||
|
||||
public static class ApiCaller
|
||||
{
|
||||
public static class ApiCaller
|
||||
public static async Task<T> GetApi<T>(string url)
|
||||
{
|
||||
public static async Task<T> GetApi<T>(string url)
|
||||
T deserializedJson = default;
|
||||
|
||||
using (HttpClient client = new())
|
||||
{
|
||||
T deserializedJson = default(T);
|
||||
|
||||
using (HttpClient client = new())
|
||||
{
|
||||
string apiResponse = await client.GetStringAsync(url);
|
||||
deserializedJson = JsonSerializer.Deserialize<T>(apiResponse);
|
||||
}
|
||||
|
||||
return deserializedJson;
|
||||
string apiResponse = await client.GetStringAsync(url);
|
||||
deserializedJson = JsonSerializer.Deserialize<T>(apiResponse);
|
||||
}
|
||||
|
||||
return deserializedJson;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user