Skip to content

Commit

Permalink
Use JsonSerializerDefaults.Web
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianEdwards committed Sep 5, 2024
1 parent f24521a commit 399fd49
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
5 changes: 1 addition & 4 deletions complete/Api/Data/NwsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ namespace Api
{
public class NwsManager(HttpClient httpClient, IMemoryCache cache, IWebHostEnvironment webHostEnvironment)
{
private static readonly JsonSerializerOptions options = new()
{
PropertyNameCaseInsensitive = true
};
private static readonly JsonSerializerOptions options = new(JsonSerializerDefaults.Web);

public async Task<Zone[]?> GetZonesAsync()
{
Expand Down
5 changes: 1 addition & 4 deletions complete/MyWeatherHub/NwsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ namespace MyWeatherHub;

public class NwsManager(HttpClient client)
{
private static readonly JsonSerializerOptions options = new()
{
PropertyNameCaseInsensitive = true
};
private static readonly JsonSerializerOptions options = new(JsonSerializerDefaults.Web);

public async Task<Zone[]> GetZonesAsync()
{
Expand Down
5 changes: 1 addition & 4 deletions start-with-api/Api/Data/NwsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ namespace Api
{
public class NwsManager(HttpClient httpClient, IMemoryCache cache, IWebHostEnvironment webHostEnvironment)
{
private static readonly JsonSerializerOptions options = new()
{
PropertyNameCaseInsensitive = true
};
private static readonly JsonSerializerOptions options = new(JsonSerializerDefaults.Web);

public async Task<Zone[]?> GetZonesAsync()
{
Expand Down
5 changes: 1 addition & 4 deletions start-with-api/MyWeatherHub/NwsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ namespace MyWeatherHub;

public class NwsManager(HttpClient client)
{
private static readonly JsonSerializerOptions options = new()
{
PropertyNameCaseInsensitive = true
};
private static readonly JsonSerializerOptions options = new(JsonSerializerDefaults.Web);

public async Task<Zone[]> GetZonesAsync()
{
Expand Down

0 comments on commit 399fd49

Please sign in to comment.