Uređivanje

Dijeli putem


JsonTypeInfoResolver.WithAddedModifier Method

Definition

Creates a resolver and applies modifications to the metadata generated by the source resolver.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Text::Json::Serialization::Metadata::IJsonTypeInfoResolver ^ WithAddedModifier(System::Text::Json::Serialization::Metadata::IJsonTypeInfoResolver ^ resolver, Action<System::Text::Json::Serialization::Metadata::JsonTypeInfo ^> ^ modifier);
public static System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver WithAddedModifier (this System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver resolver, Action<System.Text.Json.Serialization.Metadata.JsonTypeInfo> modifier);
static member WithAddedModifier : System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver * Action<System.Text.Json.Serialization.Metadata.JsonTypeInfo> -> System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver
<Extension()>
Public Function WithAddedModifier (resolver As IJsonTypeInfoResolver, modifier As Action(Of JsonTypeInfo)) As IJsonTypeInfoResolver

Parameters

resolver
IJsonTypeInfoResolver

The source resolver generating JsonTypeInfo metadata.

modifier
Action<JsonTypeInfo>

The delegate that modifies non-nullJsonTypeInfo results.

Returns

A new IJsonTypeInfoResolver instance with modifications applied.

Remarks

This method is closely related to the Modifiers property extended to arbitrary IJsonTypeInfoResolver instances.

Applies to