5internal class NullableStructSerializer<T> : BaseSerializer<T?> where T : struct
7 private readonly ISerializer<T> _inner;
9 public NullableStructSerializer(ISerializer<T> inner)
14 public override List<FaunaType> GetSupportedTypes() => _inner.GetSupportedTypes();
18 return reader.CurrentTokenType == TokenType.Null ?
new T?() : _inner.
Deserialize(ctx, ref reader);
A class representing the mapping context to be used during serialization and deserialization.
void Serialize(MappingContext ctx, Utf8FaunaWriter writer, object? o)
Serializes the provided object into the Utf8FaunaWriter.
object? ISerializer. Deserialize(MappingContext ctx, ref Utf8FaunaReader reader)
Consumes or partially consumes the provided reader and deserializes into a result.
void ISerializer. Serialize(MappingContext context, Utf8FaunaWriter writer, object? o)
Serializes the provided object onto the Utf8FaunaWriter