Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,25 @@ public Func<object>? CreateObject
private protected abstract void SetCreateObject(Delegate? createObject);
private protected Func<object>? _createObject;

private protected void AfterCreateObject()
{
// Clear any data related to the previously specified ctor
ConstructorAttributeProviderFactory = null;
ConstructorAttributeProvider = null;

if (CreateObjectWithArgs is not null)
{
_parameterInfoValuesIndex = null;
CreateObjectWithArgs = null;
ParameterCount = 0;

foreach (JsonPropertyInfo propertyInfo in PropertyList)
{
propertyInfo.AssociatedParameter = null;
}
}
}

internal Func<object>? CreateObjectForExtensionDataProperty { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,7 @@ private protected override void SetCreateObject(Delegate? createObject)
_createObject = untypedCreateObject;
_typedCreateObject = typedCreateObject;

// Clear any data related to the previously specified ctor
ConstructorAttributeProviderFactory = null;
ConstructorAttributeProvider = null;

if (CreateObjectWithArgs is not null)
{
_parameterInfoValuesIndex = null;
CreateObjectWithArgs = null;
ParameterCount = 0;

foreach (JsonPropertyInfo propertyInfo in PropertyList)
{
propertyInfo.AssociatedParameter = null;
}
}
AfterCreateObject();
}

/// <summary>
Expand Down
Loading