<PackageReference Include="System.Runtime.Serialization.Formatters" Version="11.0.0-preview.7.26381.103" />

System.Runtime.Serialization.SurrogateSelector

Assists formatters in selection of the serialization surrogate to delegate the serialization or deserialization process to.

Initializes a new instance of the SurrogateSelector class.

public virtual void AddSurrogate(Type type, StreamingContext context, ISerializationSurrogate surrogate)

Adds a surrogate to the list of checked surrogates.

public virtual void ChainSelector(ISurrogateSelector selector)

Adds the specified ISurrogateSelector that can handle a particular object type to the list of surrogates.

Returns the next selector on the chain of selectors.

public virtual ISerializationSurrogate GetSurrogate(Type type, StreamingContext context, out ISurrogateSelector selector)

Returns the surrogate for a particular type.

public virtual void RemoveSurrogate(Type type, StreamingContext context)

Removes the surrogate associated with a given type.