1using System.Collections.ObjectModel;
18 Unwrap =
new ReadOnlyCollection<IQueryFragment>(fragments);
26 : this(fragments.ToList())
33 public IReadOnlyCollection<IQueryFragment>
Unwrap {
get; }
52 t.Serialize(ctx, writer);
54 writer.WriteEndArray();
55 writer.WriteEndObject();
70 public override bool Equals(
object? o)
72 if (ReferenceEquals(
this, o))
77 return o is
QueryExpr expr && IsEqual(expr);
90 public override string ToString() => $
"QueryExpr({string.Join(",
", Fragments)})";
101 return Fragments ==
null && o.Fragments ==
null;
115 if (ReferenceEquals(left, right))
120 if (left is
null || right is
null)
125 return left.
Equals(right);
136 return !(left == right);
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,...
override bool Equals(object? o)
Determines whether the specified object is equal to the current QueryExpr.
IReadOnlyCollection< IQueryFragment > Unwrap
Gets the readonly collection of query fragments.
QueryExpr(params IQueryFragment[] fragments)
Initializes a new instance of the QueryExpr class with one or more query fragments.
override bool Equals(Query? o)
Determines whether the specified QueryExpr is equal to the current QueryExpr.
override string ToString()
Returns a string that represents the current QueryExpr.
override void Serialize(MappingContext ctx, Utf8FaunaWriter writer)
Serializes the query expression.
QueryExpr(IList< IQueryFragment > fragments)
Initializes a new instance of the QueryExpr class with a collection of query fragments.
static bool operator==(QueryExpr left, QueryExpr right)
Determines whether two specified instances of QueryExpr are equal.
static bool operator!=(QueryExpr left, QueryExpr right)
Determines whether two specified instances of QueryExpr are not equal.
IReadOnlyCollection< IQueryFragment > Fragments
Gets the readonly collection of query fragments.
override int GetHashCode()
The default hash function.
Represents the abstract base class for constructing FQL queries.
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 WriteStartObject()
Writes the beginning of an object.
Represents the base interface for a query fragment used for FQL query construction.