Muokkaa

Jaa


JsonTypeInfoResolver.Combine Method

Definition

Overloads

Combine(ReadOnlySpan<IJsonTypeInfoResolver>)

Combines multiple IJsonTypeInfoResolver sources into one.

Combine(IJsonTypeInfoResolver[])

Combines multiple IJsonTypeInfoResolver sources into one.

Combine(ReadOnlySpan<IJsonTypeInfoResolver>)

Source:
JsonTypeInfoResolver.cs

Combines multiple IJsonTypeInfoResolver sources into one.

public:
 static System::Text::Json::Serialization::Metadata::IJsonTypeInfoResolver ^ Combine(ReadOnlySpan<System::Text::Json::Serialization::Metadata::IJsonTypeInfoResolver ^> resolvers);
public static System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Combine (scoped ReadOnlySpan<System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?> resolvers);
static member Combine : ReadOnlySpan<System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver> -> System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver
Public Function Combine (resolvers As ReadOnlySpan(Of IJsonTypeInfoResolver)) As IJsonTypeInfoResolver

Parameters

resolvers
ReadOnlySpan<IJsonTypeInfoResolver>

Sequence of contract resolvers to be queried for metadata.

Returns

A IJsonTypeInfoResolver combining results from resolvers.

Remarks

The combined resolver will query each of resolvers in the specified order,

returning the first result that is non-null. If all resolvers return null,

then the combined resolver will also return null.

Can be used to combine multiple JsonSerializerContext sources,

which typically define contract metadata for small subsets of types.

It can also be used to fall back to DefaultJsonTypeInfoResolver wherever necessary.

Applies to

Combine(IJsonTypeInfoResolver[])

Source:
JsonTypeInfoResolver.cs
Source:
JsonTypeInfoResolver.cs
Source:
JsonTypeInfoResolver.cs
Source:
JsonTypeInfoResolver.cs
Source:
JsonTypeInfoResolver.cs

Combines multiple IJsonTypeInfoResolver sources into one.

public:
 static System::Text::Json::Serialization::Metadata::IJsonTypeInfoResolver ^ Combine(... cli::array <System::Text::Json::Serialization::Metadata::IJsonTypeInfoResolver ^> ^ resolvers);
public static System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Combine (params System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver[] resolvers);
public static System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Combine (params System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] resolvers);
static member Combine : System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver[] -> System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver
Public Shared Function Combine (ParamArray resolvers As IJsonTypeInfoResolver()) As IJsonTypeInfoResolver
Public Function Combine (ParamArray resolvers As IJsonTypeInfoResolver()) As IJsonTypeInfoResolver

Parameters

resolvers
IJsonTypeInfoResolver[]

Sequence of contract resolvers to be queried for metadata.

Returns

A IJsonTypeInfoResolver combining results from resolvers.

Exceptions

resolvers is null.

Remarks

The combined resolver will query each of resolvers in the specified order, returning the first result that is non-null. If all resolvers return null, then the combined resolver will also return null.

Can be used to combine multiple JsonSerializerContext sources, which typically define contract metadata for small subsets of types. It can also be used to fall back to DefaultJsonTypeInfoResolver wherever necessary.

Applies to