You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_ =>thrownewInvalidOperationException($"Failed to select a union variant for union of type '{typeof(T1).Name}', '{typeof(T2).Name}' or '{typeof(T3).Name}'.")
522
+
};
523
+
}
524
+
525
+
/// <summary>
526
+
/// Reads an inline union value from a given <see cref="Utf8JsonReader"/> instance.
527
+
/// </summary>
528
+
/// <typeparam name="T1">The first union type.</typeparam>
529
+
/// <typeparam name="T2">The second union type.</typeparam>
530
+
/// <typeparam name="T3">The third union type.</typeparam>
531
+
/// <typeparam name="T4">The fourth union type.</typeparam>
532
+
/// <param name="reader">A reference to the <see cref="Utf8JsonReader"/>.</param>
533
+
/// <param name="options">The <see cref="JsonSerializerOptions"/> to use.</param>
534
+
/// <param name="selector">A function that selects the union variant (e.g. based on the current JSON token type).</param>
535
+
/// <param name="readType1">
536
+
/// The <see cref="JsonReadFunc{T}"/> delegate that should be called to read the first union variant type, or <see langword="null"/>
537
+
/// to use the default converter for the type <typeparamref name="T1"/>.
538
+
/// </param>
539
+
/// <param name="readType2">
540
+
/// The <see cref="JsonReadFunc{T}"/> delegate that should be called to read the second union variant type, or <see langword="null"/>
541
+
/// to use the default converter for the type <typeparamref name="T2"/>.
542
+
/// </param>
543
+
/// <param name="readType3">
544
+
/// The <see cref="JsonReadFunc{T}"/> delegate that should be called to read the third union variant type, or <see langword="null"/>
545
+
/// to use the default converter for the type <typeparamref name="T3"/>.
546
+
/// </param>
547
+
/// <param name="readType4">
548
+
/// The <see cref="JsonReadFunc{T}"/> delegate that should be called to read the fourth union variant type, or <see langword="null"/>
549
+
/// to use the default converter for the type <typeparamref name="T4"/>.
550
+
/// </param>
551
+
/// <returns>A boxed value of the selected union variant.</returns>
552
+
/// <exception cref="InvalidOperationException">If no matching union variant could be selected.</exception>
_ =>thrownewInvalidOperationException($"Failed to select a union variant for union of type '{typeof(T1).Name}', '{typeof(T2).Name}', '{typeof(T3).Name}' or '{typeof(T4).Name}'.")
569
+
};
570
+
}
571
+
572
+
/// <summary>
573
+
/// Reads an inline union value from a given <see cref="Utf8JsonReader"/> instance.
574
+
/// </summary>
575
+
/// <typeparam name="T1">The first union type.</typeparam>
576
+
/// <typeparam name="T2">The second union type.</typeparam>
577
+
/// <typeparam name="T3">The third union type.</typeparam>
578
+
/// <typeparam name="T4">The fourth union type.</typeparam>
579
+
/// <typeparam name="T5">The fifth union type.</typeparam>
580
+
/// <param name="reader">A reference to the <see cref="Utf8JsonReader"/>.</param>
581
+
/// <param name="options">The <see cref="JsonSerializerOptions"/> to use.</param>
582
+
/// <param name="selector">A function that selects the union variant (e.g. based on the current JSON token type).</param>
583
+
/// <param name="readType1">
584
+
/// The <see cref="JsonReadFunc{T}"/> delegate that should be called to read the first union variant type, or <see langword="null"/>
585
+
/// to use the default converter for the type <typeparamref name="T1"/>.
586
+
/// </param>
587
+
/// <param name="readType2">
588
+
/// The <see cref="JsonReadFunc{T}"/> delegate that should be called to read the second union variant type, or <see langword="null"/>
589
+
/// to use the default converter for the type <typeparamref name="T2"/>.
590
+
/// </param>
591
+
/// <param name="readType3">
592
+
/// The <see cref="JsonReadFunc{T}"/> delegate that should be called to read the third union variant type, or <see langword="null"/>
593
+
/// to use the default converter for the type <typeparamref name="T3"/>.
594
+
/// </param>
595
+
/// <param name="readType4">
596
+
/// The <see cref="JsonReadFunc{T}"/> delegate that should be called to read the fourth union variant type, or <see langword="null"/>
597
+
/// to use the default converter for the type <typeparamref name="T4"/>.
598
+
/// </param>
599
+
/// <param name="readType5">
600
+
/// The <see cref="JsonReadFunc{T}"/> delegate that should be called to read the fifth union variant type, or <see langword="null"/>
601
+
/// to use the default converter for the type <typeparamref name="T5"/>.
602
+
/// </param>
603
+
/// <returns>A boxed value of the selected union variant.</returns>
604
+
/// <exception cref="InvalidOperationException">If no matching union variant could be selected.</exception>
_ =>thrownewInvalidOperationException($"Failed to select a union variant for union of type '{typeof(T1).Name}', '{typeof(T2).Name}', '{typeof(T3).Name}', '{typeof(T4).Name}' or '{typeof(T5).Name}'.")
0 commit comments