Table of Contents

Struct MessagePackSerializer.DeserializePathOptions<T, TElement>

Namespace
Nerdbank.MessagePack
Assembly
Nerdbank.MessagePack.dll

Specifies options for deserializing a value from a MessagePack-encoded object graph using a provided property path expression.

public record struct MessagePackSerializer.DeserializePathOptions<T, TElement> : IEquatable<MessagePackSerializer.DeserializePathOptions<T, TElement>>

Type Parameters

T

The type of the root object from which the property path is evaluated.

TElement

The type of the value at the end of the property path.

Implements
Inherited Members

Constructors

DeserializePathOptions(Expression<Func<T, TElement>>)

Specifies options for deserializing a value from a MessagePack-encoded object graph using a provided property path expression.

public DeserializePathOptions(Expression<Func<T, TElement>> Path)

Parameters

Path Expression<Func<T, TElement>>

An expression that specifies the property path to the value to be deserialized from the object graph.

Properties

DefaultForUndiscoverablePath

Gets a value indicating whether to produce default(TElement) if Path does not lead to the target value (due to a missing property or null value) in the msgpack data.

public bool DefaultForUndiscoverablePath { readonly get; init; }

Property Value

bool

The default value is false.

Remarks

When this value is false, a MessagePackSerializationException is thrown when Path does not lead to the target value.

Path

An expression that specifies the property path to the value to be deserialized from the object graph.

public Expression<Func<T, TElement>> Path { readonly get; set; }

Property Value

Expression<Func<T, TElement>>