Fauna v10 .NET/C# Driver 1.0.1
 
Loading...
Searching...
No Matches
QueryArr.cs
Go to the documentation of this file.
1using Fauna.Mapping;
3
4namespace Fauna;
5
9internal sealed class QueryArr : Query, IQueryFragment
10{
14 public IEnumerable<Query> Unwrap { get; }
15
20 public QueryArr(IEnumerable<Query> v)
21 {
22 Unwrap = v;
23 }
24
25
31 public override void Serialize(MappingContext ctx, Utf8FaunaWriter writer)
32 {
33 writer.WriteStartObject();
34 writer.WriteFieldName("array");
35 writer.WriteStartArray();
36 foreach (Query t in Unwrap)
37 {
38 var ser = Serializer.Generate(ctx, t.GetType());
39 ser.Serialize(ctx, writer, t);
40 }
41 writer.WriteEndArray();
42 writer.WriteEndObject();
43 }
44
50 public override bool Equals(Query? o)
51 {
52 return o is QueryArr other && Unwrap.SequenceEqual(other.Unwrap);
53 }
54
60 public override bool Equals(object? otherObject)
61 {
62 return Equals(otherObject as QueryArr);
63 }
64
69 public override int GetHashCode()
70 {
71 return Unwrap.GetHashCode();
72 }
73
78 public override string ToString()
79 {
80 return $"QueryArr({string.Join(", ", Unwrap)})";
81 }
82
83}
A class representing the mapping context to be used during serialization and deserialization.
Represents the abstract base class for constructing FQL queries.
Definition Query.cs:11
Provides functionality for writing data in a streaming manner to a buffer or a stream.
void WriteFieldName(string value)
Writes a field name for the next value.
void WriteStartArray()
Writes the beginning of an array.
void WriteEndArray()
Writes the end of an array.
void WriteEndObject()
Writes the end of an object.
void WriteStartObject()
Writes the beginning of an object.
Represents the base interface for a query fragment used for FQL query construction.
void ISerializer. Serialize(MappingContext context, Utf8FaunaWriter writer, object? o)
Serializes the provided object onto the Utf8FaunaWriter