Table of Contents

Class UnusedDataPacket

Namespace
Nerdbank.MessagePack
Assembly
Nerdbank.MessagePack.dll

When used as the type of a property or field on a data type, captures deserialized data that could not be assigned to a known property.

[TypeShape(Kind = TypeShapeKind.None)]
public abstract class UnusedDataPacket
Inheritance
UnusedDataPacket
Inherited Members

Examples

The following data type recognizes its own declared properties and will avoid data loss when round-tripping data from a different declaration of the class that has additional properties.

public class Person
{
    public required string Name { get; set; }

    [PropertyShape]
    private UnusedDataPacket? UnusedData { get; set; }
}