ISerializationSurrogateProvider.GetObjectToSerialize(Object, Type) Method

Definition

During serialization, returns an object that substitutes the specified object.

C#
public object GetObjectToSerialize(object obj, Type targetType);

Parameters

obj
Object

The object to substitute.

targetType
Type

The Type that the substituted object should be assigned to.

Returns

The substituted object that will be serialized.

Applies to

Производ Верзије
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0