1using System.Collections.Generic;
2using System.Threading.Tasks;
37 KeyValuePair<VariableReference, bool>[] Order,
ScriptNode Node)
40 KeyValuePair<VariableReference, bool>[] LeftOrder = await
Reduce(this.
Left, Order);
47 e =
new InnerJoinEnumerator(e, this.
Left.
Name,
this.Right,
this.Right.Name, Generic, RightWhere,
Variables);
55 if (Top !=
int.MaxValue)
67 private readonly
string leftName;
68 private readonly
string rightName;
69 private readonly
bool hasLeftName;
70 private readonly
bool generic;
79 this.leftName = LeftName;
80 this.rightName = RightName;
81 this.rightSource = RightSource;
82 this.generic = Generic;
85 this.hasLeftName = !
string.IsNullOrEmpty(this.leftName);
88 public object Current => this.current;
90 public bool MoveNext()
92 return this.MoveNextAsync().Result;
95 public async Task<bool> MoveNextAsync()
99 if (!(this.right is
null))
103 this.current =
new JoinedObject(this.left.Current,
this.leftName,
104 this.right.Current,
this.rightName);
112 if (!await this.left.MoveNextAsync())
115 if (this.leftVariables is
null)
116 this.leftVariables =
new ObjectProperties(this.left.Current,
this.variables);
118 this.leftVariables.Object = this.left.Current;
120 if (this.hasLeftName)
121 this.leftVariables[this.leftName] = this.left.Current;
123 this.right = await this.rightSource.Find(0,
int.MaxValue, this.
generic, this.conditions, this.leftVariables,
124 null, this.conditions);
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 INNER JOIN of two sources.
InnerJoinedSource(IDataSource Left, IDataSource Right, ScriptNode Conditions)
Data source formed through an INNER 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 .
Represents a joined object.
Abstract base classes of joined sources.
ScriptNode Conditions
Conditions for join.
ScriptNode Combine(ScriptNode Where, ScriptNode On)
Combines one or two restrictions.
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
Task< bool > MoveNextAsync()
Advances the enumerator to the next element of the collection.
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.