Table of Contents

ObjectCreationHandling Enum

Definition

Namespace
Bodu.Text.Serialization
Assembly
Bodu.Text.Serialization.dll
Package
Bodu.Text.Serialization 1.0.0
Source
ObjectCreationHandling.cs

Specifies whether the serializer replaces a member's value with a freshly created instance or populates the value already held by the member during deserialization.

public enum ObjectCreationHandling
Extension Methods

Fields

Replace = 0

A new instance is created and assigned to the member.

Populate = 1

The instance already held by the member is reused and populated with the read entries.

Remarks

Populate applies to collection and dictionary members: the entries read from the input are added into the existing instance, so a get-only collection property initialized in the type can round-trip. When the existing value is null or the member is not a populatable collection, the serializer falls back to replacing the value.

Applies to

ProductVersions
.NET8, 10