Fauna v10 .NET/C# Driver
0.3.0-beta
Loading...
Searching...
No Matches
Fauna
Types
BaseRefBuilder.cs
Go to the documentation of this file.
1
namespace
Fauna.Types
;
2
3
public
class
BaseRefBuilder
<T>
4
{
5
public
string
?
Id
{
get
;
set
; }
6
public
string
?
Name
{
get
;
set
; }
7
public
Module
?
Collection
{
get
;
set
; }
8
public
string
?
Cause
{
get
;
set
; }
9
public
bool
?
Exists
{
get
;
set
; }
10
public
T?
Doc
{
get
;
set
; }
11
12
public
BaseRef<T>
Build
()
13
{
14
if
(
Collection
is
null
)
throw
new
ArgumentNullException(nameof(
Collection
));
15
16
if
(
Id
is not
null
)
17
{
18
if
(
Exists
!=
null
&& !
Exists
.Value)
return
new
Ref<T>
(
Id
,
Collection
,
Cause
??
""
);
19
if
(
Doc
!=
null
)
return
new
Ref<T>
(
Id
,
Collection
,
Doc
);
20
return
new
Ref<T>
(
Id
,
Collection
);
21
}
22
23
if
(
Name
is not
null
)
24
{
25
if
(
Exists
!=
null
&& !
Exists
.Value)
return
new
NamedRef<T>
(
Name
,
Collection
,
Cause
??
""
);
26
if
(
Doc
!=
null
)
return
new
NamedRef<T>
(
Name
,
Collection
,
Doc
);
27
return
new
NamedRef<T>
(
Name
,
Collection
);
28
}
29
30
throw
new
ArgumentException
(
"Id and Name cannot both be null"
);
31
}
32
}
ArgumentException
System.ArgumentException ArgumentException
Definition
ListSerializer.cs:4
Fauna.Types.BaseRefBuilder
Definition
BaseRefBuilder.cs:4
Fauna.Types.BaseRefBuilder.Collection
Module? Collection
Definition
BaseRefBuilder.cs:7
Fauna.Types.BaseRefBuilder.Cause
string? Cause
Definition
BaseRefBuilder.cs:8
Fauna.Types.BaseRefBuilder.Name
string? Name
Definition
BaseRefBuilder.cs:6
Fauna.Types.BaseRefBuilder.Exists
bool? Exists
Definition
BaseRefBuilder.cs:9
Fauna.Types.BaseRefBuilder.Doc
T? Doc
Definition
BaseRefBuilder.cs:10
Fauna.Types.BaseRefBuilder.Build
BaseRef< T > Build()
Definition
BaseRefBuilder.cs:12
Fauna.Types.BaseRefBuilder.Id
string? Id
Definition
BaseRefBuilder.cs:5
Fauna.Types.BaseRef
Definition
BaseRef.cs:6
Fauna.Types.Module
Represents a module, a singleton object grouping related functionalities. Modules are serialized as @...
Definition
Module.cs:8
Fauna.Types.NamedRef
Represents a document ref that has a "name" instead of an "id". For example, a Role document referenc...
Definition
NamedRef.cs:12
Fauna.Types.Ref
Represents a document ref.
Definition
Ref.cs:11
Fauna.Types
Definition
BaseRef.cs:3
Generated by
1.12.0