JsonTypeInfoResolver.Combine(IJsonTypeInfoResolver[]) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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);
static member Combine : System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver[] -> System.Text.Json.Serialization.Metadata.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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for