}
JsonClassInfo runtimeClassInfo = jsonPropertyInfo.RuntimeClassInfo;
- if (runtimeClassInfo.CreateObject != null)
- {
- return runtimeClassInfo.CreateObject();
- }
- else
+
+ if (runtimeClassInfo.CreateObject == null)
{
- // Could not create an instance to be returned. For derived types, this means there is no parameterless ctor.
- throw ThrowHelper.GetNotSupportedException_SerializationNotSupportedCollection(
- jsonPropertyInfo.DeclaredPropertyType,
- jsonPropertyInfo.ParentClassType,
- jsonPropertyInfo.PropertyInfo);
+ ThrowHelper.ThrowNotSupportedException_DeserializeCreateObjectDelegateIsNull(jsonPropertyInfo.DeclaredPropertyType);
}
+
+ return runtimeClassInfo.CreateObject();
}
public static object CreateDictionaryValue(ref ReadStack state)
}
JsonClassInfo runtimeClassInfo = jsonPropertyInfo.RuntimeClassInfo;
- if (runtimeClassInfo.CreateObject != null)
- {
- return runtimeClassInfo.CreateObject();
- }
- else
+
+ if (runtimeClassInfo.CreateObject == null)
{
- // Could not create an instance to be returned. For derived types, this means there is no parameterless ctor.
- throw ThrowHelper.GetNotSupportedException_SerializationNotSupportedCollection(
- jsonPropertyInfo.DeclaredPropertyType,
- jsonPropertyInfo.ParentClassType,
- jsonPropertyInfo.PropertyInfo);
+ ThrowHelper.ThrowNotSupportedException_DeserializeCreateObjectDelegateIsNull(jsonPropertyInfo.DeclaredPropertyType);
}
+
+ return runtimeClassInfo.CreateObject();
}
public Type GetElementType()