Skip to content

Commit

Permalink
Merge pull request #67 from baywet/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissainty authored Nov 29, 2022
2 parents 0a1a428 + 4c1a6c3 commit 7d2b397
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ From v4 onwards we use the default the `JsonSerializerOptions` for `System.Text.
To retain the old settings use the following configuration when adding Blazored SessionStorage to the DI container:

```csharp
builder.Services.AddBlazoredSessionStorage(config =>
config.JsonSerializerOptions.DictionaryKeyPolicy = JsonNamingPolicy.CamelCase;
config.JsonSerializerOptions.IgnoreNullValues = true;
config.JsonSerializerOptions.IgnoreReadOnlyProperties = true;
config.JsonSerializerOptions.PropertyNameCaseInsensitive = true;
config.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
config.JsonSerializerOptions.ReadCommentHandling = JsonCommentHandling.Skip;
config.JsonSerializerOptions.WriteIndented = false;
builder.Services.AddBlazoredSessionStorage(config => {
config.JsonSerializerOptions.DictionaryKeyPolicy = JsonNamingPolicy.CamelCase;
config.JsonSerializerOptions.IgnoreNullValues = true;
config.JsonSerializerOptions.IgnoreReadOnlyProperties = true;
config.JsonSerializerOptions.PropertyNameCaseInsensitive = true;
config.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
config.JsonSerializerOptions.ReadCommentHandling = JsonCommentHandling.Skip;
config.JsonSerializerOptions.WriteIndented = false;
}
);
```

Expand Down

0 comments on commit 7d2b397

Please sign in to comment.