internal JsonPropertyInfo GetJsonPropertyInfoFromClassInfo(JsonClassInfo classInfo, JsonSerializerOptions options) { Type objectType = classInfo.Type; if (!_objectJsonProperties.TryGetValue(objectType, out JsonPropertyInfo propertyInfo)) { propertyInfo = JsonClassInfo.CreateProperty(objectType, objectType, null, typeof(object), options); _objectJsonProperties[objectType] = propertyInfo; } return(propertyInfo); }
internal JsonPropertyInfo GetJsonPropertyInfoFromClassInfo(JsonClassInfo classInfo, JsonSerializerOptions options) { if (classInfo.ClassType == ClassType.KeyValuePair) { return(classInfo.GetPolicyPropertyOfKeyValuePair()); } if (classInfo.ClassType != ClassType.Object) { return(classInfo.GetPolicyProperty()); } Type objectType = classInfo.Type; if (!_objectJsonProperties.TryGetValue(objectType, out JsonPropertyInfo propertyInfo)) { propertyInfo = JsonClassInfo.CreateProperty(objectType, objectType, null, typeof(object), options); _objectJsonProperties[objectType] = propertyInfo; } return(propertyInfo); }