ImmutableDictionaryOfTKeyTValueConverterWithReflection<TCollection, TKey, TValue>
using System.
Collections.
Generic;
using System.
Diagnostics.
CodeAnalysis;
using System.
Text.
Json.
Serialization.
Metadata;
namespace System.
Text.
Json.
Serialization.
Converters
{
internal sealed class ImmutableDictionaryOfTKeyTValueConverterWithReflection<
TCollection,
TKey,
TValue> :
ImmutableDictionaryOfTKeyTValueConverter<
TCollection,
TKey,
TValue>
where TCollection :
IReadOnlyDictionary<
TKey,
TValue>
{
[
System.
Diagnostics.
CodeAnalysis.
RequiresUnreferencedCode(
"System.Collections.Immutable converters use Reflection to find and create Immutable Collection types, which requires unreferenced code.")]
[
System.
Diagnostics.
CodeAnalysis.
RequiresDynamicCode(
"System.Collections.Immutable converters use Reflection to find and create Immutable Collection types, which requires unreferenced code.")]
public ImmutableDictionaryOfTKeyTValueConverterWithReflection()
{
}
[
System.
Diagnostics.
CodeAnalysis.
RequiresUnreferencedCode(
"System.Collections.Immutable converters use Reflection to find and create Immutable Collection types, which requires unreferenced code.")]
[
System.
Diagnostics.
CodeAnalysis.
RequiresDynamicCode(
"System.Collections.Immutable converters use Reflection to find and create Immutable Collection types, which requires unreferenced code.")]
internal override void ConfigureJsonTypeInfoUsingReflection(
JsonTypeInfo jsonTypeInfo,
JsonSerializerOptions options)
{
jsonTypeInfo.
CreateObjectWithArgs =
options.
MemberAccessorStrategy.
CreateImmutableDictionaryCreateRangeDelegate<
TCollection,
TKey,
TValue>();
}
}
}