Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Ignore null fields when serializing state
Browse files Browse the repository at this point in the history
  • Loading branch information
YuriyDurov committed May 15, 2024
1 parent 90d7797 commit b93d73e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/BitzArt.Blazor.MVVM/Models/PageBase.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Components;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace BitzArt.Blazor.MVVM;

Expand Down Expand Up @@ -74,6 +75,7 @@ internal static class StateJsonOptionsProvider
public static readonly JsonSerializerOptions Options = new()
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
PropertyNameCaseInsensitive = true
PropertyNameCaseInsensitive = true,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
};
}

0 comments on commit b93d73e

Please sign in to comment.