private static JsonTypeInfo GetTypeInfo(JsonSerializerContext context, Type type) { Debug.Assert(context != null); Debug.Assert(type != null); JsonTypeInfo?info = context.GetTypeInfo(type); if (info is null) { ThrowHelper.ThrowInvalidOperationException_NoMetadataForType(type); } return(info); }
private static JsonTypeInfo GetTypeInfo(JsonSerializerContext context, Type inputType) { Debug.Assert(context != null); Debug.Assert(inputType != null); JsonTypeInfo?info = context.GetTypeInfo(inputType); if (info is null) { ThrowHelper.ThrowInvalidOperationException_NoMetadataForType(inputType, context); } info.EnsureConfigured(); return(info); }