示例#1
0
            public async Task <bool> MoveNextAsync()
            {
                while (true)
                {
                    if (!(this.right is null))
                    {
                        if (await this.right.MoveNextAsync())
                        {
                            this.current = new JoinedObject(this.left.Current, this.leftName,
                                                            this.right.Current, this.rightName);

                            return(true);
                        }
                        else
                        {
                            this.right = null;
                        }
                    }

                    if (!await this.left.MoveNextAsync())
                    {
                        return(false);
                    }

                    ObjectProperties LeftVariables = new ObjectProperties(this.left.Current, this.variables);

                    if (this.hasLeftName)
                    {
                        LeftVariables[this.leftName] = this.left.Current;
                    }

                    this.right = await this.rightSource.Find(0, int.MaxValue, this.conditions, LeftVariables,
                                                             null, this.conditions);
                }
            }
 public void Reset()
 {
     this.current = null;
     this.right   = null;
     this.left.Reset();
 }
            public async Task <bool> MoveNextAsync()
            {
                while (true)
                {
                    if (!(this.right is null))
                    {
                        bool First = this.rightFirst;
                        this.rightFirst = false;

                        if (await this.right.MoveNextAsync())
                        {
                            if (this.flipped)
                            {
                                this.current = new JoinedObject(this.right.Current, this.rightName,
                                                                this.left.Current, this.leftName);
                            }
                            else
                            {
                                this.current = new JoinedObject(this.left.Current, this.leftName,
                                                                this.right.Current, this.rightName);
                            }

                            return(true);
                        }
                        else
                        {
                            this.right = null;

                            if (First)
                            {
                                if (this.defaultRight is null)
                                {
                                    this.defaultRight = new GenericObject(this.rightSource.CollectionName,
                                                                          typeof(GenericObject).FullName, Guid.Empty,
                                                                          new KeyValuePair <string, object> [0]);
                                }

                                if (this.flipped)
                                {
                                    this.current = new JoinedObject(this.defaultRight, this.rightName,
                                                                    this.left.Current, this.leftName);
                                }
                                else
                                {
                                    this.current = new JoinedObject(this.left.Current, this.leftName,
                                                                    this.defaultRight, this.rightName);
                                }

                                return(true);
                            }
                        }
                    }

                    if (!await this.left.MoveNextAsync())
                    {
                        return(false);
                    }

                    ObjectProperties LeftVariables = new ObjectProperties(this.left.Current, this.variables);

                    if (this.hasLeftName)
                    {
                        LeftVariables[this.leftName] = this.left.Current;
                    }

                    this.right = await this.rightSource.Find(0, int.MaxValue, this.conditions, LeftVariables,
                                                             null, this.conditions);

                    this.rightFirst = true;
                }
            }