Fauna v10 .NET/C# Driver
0.2.0-beta
Loading...
Searching...
No Matches
Fauna
Query
QueryArr.cs
Go to the documentation of this file.
1
using
System.Collections;
2
using
System.Collections.ObjectModel;
3
using
Fauna.Mapping
;
4
using
Fauna.Serialization
;
5
6
namespace
Fauna
;
7
8
internal
sealed
class
QueryArr<T> :
Query
,
IQueryFragment
, IEnumerable<T>
9
{
10
public
QueryArr(IEnumerable<T> v)
11
{
12
if
(v ==
null
)
13
{
14
throw
new
ArgumentNullException(nameof(v),
"Value cannot be null."
);
15
}
16
17
Unwrap =
new
ReadOnlyCollection<T>(v.ToList());
18
}
19
20
public
ReadOnlyCollection<T> Unwrap {
get
; }
21
22
public
int
Count => Unwrap.Count;
23
24
public
T
this
[
int
index] => Unwrap[index];
25
26
public
override
void
Serialize(
MappingContext
ctx,
Utf8FaunaWriter
writer)
27
{
28
throw
new
NotImplementedException();
29
}
30
31
public
override
bool
Equals(
Query
? o)
32
{
33
return
o is QueryArr<T> other && Unwrap.SequenceEqual(other.Unwrap);
34
}
35
36
public
override
bool
Equals(
object
? otherObject)
37
{
38
return
Equals(otherObject as
Query
);
39
}
40
41
public
override
int
GetHashCode()
42
{
43
unchecked
44
{
45
int
hash = 17;
46
for
(
int
i = 0; i < Unwrap.Count; i++)
47
{
48
T item = Unwrap[i];
49
hash = hash * 31 + (item?.GetHashCode() ?? 0);
50
}
51
return
hash;
52
}
53
}
54
55
public
override
string
ToString()
56
{
57
return
$
"QueryArr({string.Join("
,
", Unwrap)})"
;
58
}
59
60
public
IEnumerator<T> GetEnumerator()
61
{
62
return
Unwrap.GetEnumerator();
63
}
64
65
IEnumerator IEnumerable.GetEnumerator()
66
{
67
return
GetEnumerator();
68
}
69
}
Fauna.Mapping.MappingContext
A class representing the mapping context to be used during serialization and deserialization.
Definition
MappingContext.cs:9
Fauna.Query
Represents the abstract base class for constructing FQL queries.
Definition
Query.cs:11
Fauna.Serialization.Utf8FaunaWriter
Provides functionality for writing data in a streaming manner to a buffer or a stream.
Definition
Utf8FaunaWriter.cs:13
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
ISerializer.cs:3
Fauna
Definition
Client.cs:8
Generated by
1.12.0