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
actualAttributeTypeThe type of the value, as ReadStartAttribute() returned it.
expectedAttributeTypeThe 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
actualis notexpected. The message names both types and never the value.