Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update src/libraries/System.Text.Json/src/System/Text/Json/Serializat…
…ion/JsonSerializerContext.cs

Co-authored-by: Stephen Toub <[email protected]>
  • Loading branch information
eiriktsarpalis and stephentoub authored Jul 7, 2022
commit 56b166522ece2625f85ec7083588c2b940702924
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,8 @@ public abstract partial class JsonSerializerContext : IJsonTypeInfoResolver
/// <remarks>
/// The options instance cannot be mutated once it is bound to the context instance.
/// </remarks>
public JsonSerializerOptions Options
{
get
{
if (_options is null)
{
var options = new JsonSerializerOptions { TypeInfoResolver = this, IsLockedInstance = true };
_options = options;
}

return _options;
}
public JsonSerializerOptions Options =>
_options ??= new JsonSerializerOptions { TypeInfoResolver = this, IsLockedInstance = true };

internal set
{
Expand Down