Fauna v10 .NET/C# Driver 1.0.0
 
Loading...
Searching...
No Matches
QueryExprSerializer.cs
Go to the documentation of this file.
2using Fauna.Mapping;
3using Fauna.Types;
4
5namespace Fauna.Serialization;
6
7
8internal class QueryExprSerializer : BaseSerializer<QueryExpr>
9{
10 public override QueryExpr Deserialize(MappingContext ctx, ref Utf8FaunaReader reader) =>
11 throw new NotImplementedException();
12
13 public override void Serialize(MappingContext context, Utf8FaunaWriter writer, object? obj)
14 {
15 switch (obj)
16 {
17 case null:
18 writer.WriteNullValue();
19 break;
20 case QueryExpr o:
21 writer.WriteStartObject();
22 writer.WriteFieldName("fql");
23 writer.WriteStartArray();
24 foreach (var t in o.Unwrap)
25 {
26 var ser = Serializer.Generate(context, t.GetType());
27 ser.Serialize(context, writer, t);
28 }
29 writer.WriteEndArray();
30 writer.WriteEndObject();
31 break;
32 default:
34 }
35 }
36}
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 an FQL query expression. This class encapsulates a list of IQueryFragment instances,...
Definition QueryExpr.cs:11
override void Serialize(MappingContext ctx, Utf8FaunaWriter writer)
Serializes the query expression.
Definition QueryExpr.cs:45
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