3internal class BaseRefBuilder<T>
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; }
12 public BaseRef<T> Build()
14 if (Collection is
null)
throw new ArgumentNullException(nameof(Collection));
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);
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);
System.ArgumentException ArgumentException
Fauna.Types.Module Module