Fauna v10 .NET/C# Driver
1.0.1
Loading...
Searching...
No Matches
repo.git
Fauna
Query
QueryLiteral.cs
Go to the documentation of this file.
1
using
Fauna.Mapping
;
2
using
Fauna.Serialization
;
3
4
namespace
Fauna
;
5
9
public
sealed
class
QueryLiteral
:
IQueryFragment
10
{
16
public
QueryLiteral
(
string
v)
17
{
18
if
(v ==
null
)
19
{
20
throw
new
ArgumentNullException(nameof(v),
"Value cannot be null."
);
21
}
22
23
Unwrap
= v;
24
}
25
29
public
string
Unwrap
{
get
; }
30
35
public
override
string
ToString
()
36
{
37
return
$
"QueryLiteral({Unwrap})"
;
38
}
39
45
public
void
Serialize
(
MappingContext
ctx,
Utf8FaunaWriter
writer)
46
{
47
writer.
WriteStringValue
(
Unwrap
);
48
}
49
55
public
override
bool
Equals
(
object
? other)
56
{
57
var otherQuery = other as
IQueryFragment
;
58
59
if
(otherQuery is
null
)
60
{
61
return
false
;
62
}
63
64
if
(ReferenceEquals(
this
, otherQuery))
65
{
66
return
true
;
67
}
68
69
if
(otherQuery is
QueryLiteral
otherLiteral)
70
{
71
return
Unwrap
== otherLiteral.Unwrap;
72
}
73
74
return
false
;
75
}
76
81
public
override
int
GetHashCode
()
82
{
83
return
Unwrap
.GetHashCode();
84
}
85
92
public
static
bool
operator ==
(
QueryLiteral
left,
QueryLiteral
right)
93
{
94
return
Equals
(left, right);
95
}
96
103
public
static
bool
operator !=
(
QueryLiteral
left,
QueryLiteral
right)
104
{
105
return
!
Equals
(left, right);
106
}
107
}
Fauna.Mapping.MappingContext
A class representing the mapping context to be used during serialization and deserialization.
Definition
MappingContext.cs:10
Fauna.QueryLiteral
Represents a literal part of an FQL query. This class is used for embedding raw string values directl...
Definition
QueryLiteral.cs:10
Fauna.QueryLiteral.Equals
override bool Equals(object? other)
Determines whether the specified object is equal to the current QueryLiteral.
Definition
QueryLiteral.cs:55
Fauna.QueryLiteral.GetHashCode
override int GetHashCode()
The default hash function.
Definition
QueryLiteral.cs:81
Fauna.QueryLiteral.QueryLiteral
QueryLiteral(string v)
Initializes a new instance of the QueryLiteral class with the specified value.
Definition
QueryLiteral.cs:16
Fauna.QueryLiteral.operator==
static bool operator==(QueryLiteral left, QueryLiteral right)
Determines whether two specified instances of QueryLiteral are equal.
Definition
QueryLiteral.cs:92
Fauna.QueryLiteral.Unwrap
string Unwrap
Gets the string value of the query literal.
Definition
QueryLiteral.cs:29
Fauna.QueryLiteral.operator!=
static bool operator!=(QueryLiteral left, QueryLiteral right)
Determines whether two specified instances of QueryLiteral are not equal.
Definition
QueryLiteral.cs:103
Fauna.QueryLiteral.Serialize
void Serialize(MappingContext ctx, Utf8FaunaWriter writer)
Serializes the query literal.
Definition
QueryLiteral.cs:45
Fauna.QueryLiteral.ToString
override string ToString()
Returns a string that represents the current QueryLiteral.
Definition
QueryLiteral.cs:35
Fauna.Serialization.Utf8FaunaWriter
Provides functionality for writing data in a streaming manner to a buffer or a stream.
Definition
Utf8FaunaWriter.cs:13
Fauna.Serialization.Utf8FaunaWriter.WriteStringValue
void WriteStringValue(string value)
Writes a string value as a tagged element.
Definition
Utf8FaunaWriter.cs:327
Fauna.IQueryFragment
Represents the base interface for a query fragment used for FQL query construction.
Definition
IQueryFragment.cs:11
Fauna.Mapping
Definition
Attributes.cs:1
Fauna.Serialization
Definition
BaseRefSerializer.cs:5
Fauna
Definition
Client.cs:10
Generated by
1.9.8