Fix crash on Windows (Reflection-based serialization has been disabled for this application)
This commit is contained in:
@@ -128,7 +128,12 @@ public class TimesheetService
|
|||||||
|
|
||||||
string jsonResponse = await response.Content.ReadAsStringAsync();
|
string jsonResponse = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
JsonSerializerOptions options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true };
|
JsonSerializerOptions options = new JsonSerializerOptions
|
||||||
|
{
|
||||||
|
PropertyNameCaseInsensitive = true,
|
||||||
|
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||||
|
WriteIndented = true
|
||||||
|
};
|
||||||
JsonObject? data = JsonSerializer.Deserialize<JsonObject>(jsonResponse, options);
|
JsonObject? data = JsonSerializer.Deserialize<JsonObject>(jsonResponse, options);
|
||||||
|
|
||||||
foreach (KeyValuePair<string, JsonNode> item in data)
|
foreach (KeyValuePair<string, JsonNode> item in data)
|
||||||
|
|||||||
Reference in New Issue
Block a user