Fauna v10 .NET/C# Driver 1.0.1
 
Loading...
Searching...
No Matches
QueryObjSerializer.cs
Go to the documentation of this file.
2using Fauna.Mapping;
3
4namespace Fauna.Serialization;
5
6
7internal class QueryObjSerializer : BaseSerializer<QueryObj>
8{
9 public override QueryObj Deserialize(MappingContext ctx, ref Utf8FaunaReader reader) =>
10 throw new NotImplementedException();
11
12 public override void Serialize(MappingContext context, Utf8FaunaWriter writer, object? obj)
13 {
14 switch (obj)
15 {
16 case null:
17 writer.WriteNullValue();
18 break;
19 case QueryObj o:
20 writer.WriteStartObject();
21 writer.WriteFieldName("object");
22 var ser = Serializer.Generate(context, o.Unwrap.GetType());
23 ser.Serialize(context, writer, o.Unwrap);
24 writer.WriteEndObject();
25 break;
26 default:
28 }
29 }
30}
Represents error that occur during serialization and deserialization of Fauna data.
A class representing the mapping context to be used during serialization and deserialization.
Represents a dictionary of FQL queries.
Definition QueryObj.cs:10
override void Serialize(MappingContext ctx, Utf8FaunaWriter writer)
Serializes the query value.
Definition QueryObj.cs:30
string UnsupportedSerializationTypeMessage(Type type)
A helper to build an unsupported serialization type exception message.
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