Table of Contents

Class ConverterChecks

Namespace
DynaSharp.Serialization
Assembly
DynaSharp.dll

The checks every converter makes before it reads a value. Converters and the code the source generator emits call them, so a wrong type is reported the same way everywhere.

public static class ConverterChecks
Inheritance
ConverterChecks
Inherited Members

Methods

Expect(AttributeType, AttributeType)

Checks that an attribute value has the type the converter reads.

public static void Expect(AttributeType actual, AttributeType expected)

Parameters

actual AttributeType

The type of the value, as ReadStartAttribute() returned it.

expected AttributeType

The type the converter reads.

Remarks

A {"NULL":true} is a wrong type like any other here; converters of nullable types test for Null before they call the converter of the underlying type.

Exceptions

JsonException

actual is not expected. The message names both types and never the value.