Exemple #1
0
 // This method gets the runtime information for a given type or property.
 // The runtime information consists of the following:
 // - class type,
 // - element type (if the type is a collection),
 // - the converter (either native or custom), if one exists.
 private static JsonConverter GetConverter(
     Type type,
     Type?parentClassType,
     MemberInfo?memberInfo,
     JsonSerializerOptions options)
 {
     Debug.Assert(type != null);
     Debug.Assert(!IsInvalidForSerialization(type), $"Type `{type.FullName}` should already be validated.");
     return(options.GetConverterFromMember(parentClassType, type, memberInfo));
 }