1using System.Collections.Generic;
2using System.Threading.Tasks;
38 KeyValuePair<VariableReference, bool>[] Order,
ScriptNode Node)
41 KeyValuePair<VariableReference, bool>[] LeftOrder = await
Reduce(this.
Left, Order);
48 this.Combine(RightWhere,
this.Conditions),
Variables,
false);
51 KeyValuePair<VariableReference, bool>[] RightOrder2 = await
Reduce(this.
Right, Order);
58 this.Combine(LeftWhere2,
this.Conditions),
Variables,
true);
68 if (Top !=
int.MaxValue)
76 private readonly Dictionary<object, bool> reportedLeft =
new Dictionary<object, bool>();
79 private object current;
80 private bool leftMode;
85 this.rightEnum =
Right;
90 public object Current => this.current;
92 public bool MoveNext()
94 return this.MoveNextAsync().Result;
97 public async Task<bool> MoveNextAsync()
101 if (await this.leftEnum.MoveNextAsync())
103 this.current = this.leftEnum.Current;
104 this.reportedLeft[this.current] =
true;
108 this.leftMode =
false;
113 if (await this.rightEnum.MoveNextAsync())
114 this.current = this.rightEnum.Current;
118 while (this.reportedLeft.ContainsKey(
this.current));
125 this.reportedLeft.Clear();
127 this.leftMode =
true;
128 this.leftEnum.Reset();
129 this.rightEnum.Reset();
Base class for all nodes in a parsed script tree.
Enumerator that only returns elements matching a set of conditions.
Enumerator that limits the return set to a maximum number of records.
Enumerator that skips a given number of result records.
Data source formed through an (FULL [OUTER]|OUTER) JOIN of two sources.
override async Task< IResultSetEnumerator > Find(int Offset, int Top, bool Generic, ScriptNode Where, Variables Variables, KeyValuePair< VariableReference, bool >[] Order, ScriptNode Node)
Finds objects matching filter conditions in Where .
FullOuterJoinedSource(IDataSource Left, IDataSource Right, ScriptNode Conditions)
Data source formed through an (FULL [OUTER]|OUTER) JOIN of two sources.
Abstract base classes of joined sources.
ScriptNode Conditions
Conditions for join.
IDataSource Left
Left source
static async Task< ScriptNode > Reduce(IDataSource Source, ScriptNode Where)
Reduces a where clause to fit the current data source.
IDataSource Right
Right source
Data source formed through an LEFT [OUTER] JOIN of two sources.
Interface for result-set enumerators.
Interface for data sources that can be used in SQL statements.
Task< IResultSetEnumerator > Find(int Offset, int Top, bool Generic, ScriptNode Where, Variables Variables, KeyValuePair< VariableReference, bool >[] Order, ScriptNode Node)
Finds objects matching filter conditions in Where .
string Name
Collection name or alias.