7internal class NullableDocumentSerializer<T> : BaseSerializer<NullableDocument<T>> where T : class
 
    9    private static readonly DocumentSerializer<NullableDocument<Document>> _nullableDoc = 
new();
 
   10    private static readonly DocumentSerializer<NullableDocument<NamedDocument>> _nullableNamedDoc = 
new();
 
   11    private static readonly DocumentSerializer<NullableDocument<Ref>> _nullabelDocRef = 
new();
 
   12    private static readonly DocumentSerializer<NullableDocument<NamedRef>> _nullabelNamedDocRef = 
new();
 
   14    public NullableDocumentSerializer()
 
   21            throw new SerializationException(
 
   22                $
"Unexpected token while deserializing into {typeof(NullableDocument<T>)}: {reader.CurrentTokenType}");
 
   26        if (typeof(T) == typeof(
Ref)) 
return (_nullabelDocRef.Deserialize(context, ref reader) as 
NullableDocument<T>)!;
 
   29        var info = context.
GetInfo(typeof(T));
 
   32            var v = info.ClassSerializer.Deserialize(context, ref reader);
 
   35        catch (NullDocumentException e)
 
   41    public override void Serialize(
MappingContext context, Utf8FaunaWriter writer, 
object? o)
 
   43        DynamicSerializer.Singleton.Serialize(context, writer, o);
 
A class representing the mapping context to be used during serialization and deserialization.
 
MappingInfo GetInfo(Type ty, string? colName=null)
Gets the MappingInfo for a given Type.
 
Represents a document that has a "name" instead of an "id". For example, a Role document is represent...
 
Represents a document ref that has a "name" instead of an "id". For example, a Role document referenc...
 
A class wrapping a non-null document returned by Fauna.
 
A class representing a null document returned by Fauna.
 
A wrapper class that allows Document and user-defined classes to be null references.
 
Represents a document ref.
 
TokenType
Enumerates the types of tokens used in Fauna serialization.