Class ValueObjectResolver
Namespace: AdCodicem.ValueObjects.MessagePack
Assembly: AdCodicem.ValueObjects.MessagePack.dll
Answers the formatter of any value object, closed over it at compile time through the descriptor's visitor, and nothing else.
public sealed class ValueObjectResolver : IFormatterResolver
Inheritance
Implements
IFormatterResolver
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks
It answers null for any other type, and for a NullableFormatter then writes and reads a
nil for a TSelf? holding nothing and asks this resolver for TSelf otherwise. Placed first, before
StandardResolver, ContractlessStandardResolver or SignalR's own, it is the one MessagePack asks for a
value object, which no other resolver writes as its value: StandardResolver knows no formatter for one, and a
contractless resolver writes it as an empty map, {}, read back as the default instance.
A value object the registry holds is closed through
Properties
Instance
Gets the resolver whose formatters read through the value objects' rules.
public static ValueObjectResolver Instance { get; }
Property Value
Trusted
Gets the resolver whose formatters read without validating, for a cache or a store the application alone writes.
public static ValueObjectResolver Trusted { get; }
Property Value
Methods
GetFormatter<T>()
Gets an T.
public IMessagePackFormatter<T>? GetFormatter<T>()
Returns
IMessagePackFormatter<T>?
A formatter, if this resolver supplies one for type T; otherwise null.
Type Parameters
T
The type of value to be serialized or deserialized.