Fauna v10 .NET/C# Driver
1.0.1
Loading...
Searching...
No Matches
repo.git
Fauna
Types
BaseRef.cs
Go to the documentation of this file.
1
using
Fauna.Linq
;
2
3
namespace
Fauna.Types
;
4
9
public
abstract
class
BaseRef
<T>
10
{
11
16
protected
readonly T?
Doc
;
17
21
public
string
?
Cause
{
get
; }
22
26
public
Module
Collection
{
get
; }
27
31
public
bool
?
Exists
{
get
; }
32
36
public
bool
IsLoaded
{
get
; }
37
38
internal
BaseRef
(
DataContext
.
ICollection
col)
39
{
40
Collection
=
new
Module
(col.Name);
41
}
42
43
44
internal
BaseRef(
DataContext
.
ICollection
col, T doc)
45
{
46
Collection
=
new
Module
(col.Name);
47
Doc
= doc;
48
IsLoaded
=
true
;
49
Exists
=
true
;
50
}
51
52
internal
BaseRef(
DataContext
.
ICollection
col,
string
cause)
53
{
54
Collection
=
new
Module
(col.Name);
55
Exists
=
false
;
56
Cause
= cause;
57
IsLoaded
=
true
;
58
}
59
60
internal
BaseRef(
Module
coll)
61
{
62
Collection
= coll;
63
}
64
65
internal
BaseRef(
Module
coll, T doc)
66
{
67
Collection
= coll;
68
Exists
=
true
;
69
Doc
= doc;
70
IsLoaded
=
true
;
71
}
72
73
internal
BaseRef(
Module
coll,
string
cause)
74
{
75
Collection
= coll;
76
Exists
=
false
;
77
Cause
= cause;
78
IsLoaded
=
true
;
79
}
80
85
public
abstract
T
Get
();
86
}
87
88
internal
class
UnloadedRefException : Exception
89
{
90
}
Module
Fauna.Types.Module Module
Definition
MappingInfo.cs:4
Fauna.Linq.DataContext
An abstract class representing a DataContext. This is a special type of Fauna client that can be used...
Definition
DataContext.cs:17
Fauna.Types.BaseRef
An abstract class representing a reference that can wrap an instance of the referenced document.
Definition
BaseRef.cs:10
Fauna.Types.BaseRef.Doc
readonly? T Doc
Gets the materialized document represented by the Ref. Is null unless IsLoaded is true and Exists is ...
Definition
BaseRef.cs:16
Fauna.Types.BaseRef.Cause
string? Cause
Gets the cause when exists is false. Is null unless IsLoaded is true and Exists is false.
Definition
BaseRef.cs:21
Fauna.Types.BaseRef.IsLoaded
bool IsLoaded
Gets a boolean indicating whether the document represented by the ref has been loaded.
Definition
BaseRef.cs:36
Fauna.Types.BaseRef.Get
T Get()
Gets the underlying document if it's loaded and exists.
Fauna.Types.BaseRef.Collection
Module Collection
Gets the collection to which the ref belongs.
Definition
BaseRef.cs:26
Fauna.Types.BaseRef.Exists
bool? Exists
Gets a boolean indicating whether the doc exists. Is null unless IsLoaded is true.
Definition
BaseRef.cs:31
Fauna.Types.Module
Represents a module, a singleton object grouping related functionalities. Modules are serialized as @...
Definition
Module.cs:8
Fauna.Linq.DataContext.ICollection
An interface for a Fauna collection within a DataContext.
Definition
DataContext.cs:99
Fauna.Linq
Definition
DataContext.cs:9
Fauna.Types
Definition
BaseRef.cs:3
Generated by
1.9.8