Пример #1
0
            public override IEnumerable ExecuteSubQuery(int iSubQuery, object[] parentArgs)
            {
                if (session.ParentArguments != null)
                {
                    int length           = session.ParentArguments.Length;
                    var destinationArray = new object[length + parentArgs.Length];
                    Array.Copy(session.ParentArguments, destinationArray, length);
                    Array.Copy(parentArgs, 0, destinationArray, length, parentArgs.Length);
                    parentArgs = destinationArray;
                }
                ICompiledSubQuery query = session.SubQueries[iSubQuery];

                return((IEnumerable)query.Execute(session.Provider, parentArgs, session.UserArguments).ReturnValue);
            }
Пример #2
0
        public override IEnumerable ExecuteSubQuery(int iSubQuery, object[] parentArgs)
        {
            if (this.Session.ParentArguments != null)
            {
                // Create array to accumulate args, and add both parent
                // args and the supplied args to the array
                int      nParent = this.Session.ParentArguments.Length;
                object[] tmp     = new object[nParent + parentArgs.Length];
                Array.Copy(this.Session.ParentArguments, tmp, nParent);
                Array.Copy(parentArgs, 0, tmp, nParent, parentArgs.Length);
                parentArgs = tmp;
            }
            ICompiledSubQuery subQuery = this.Session.SubQueries[iSubQuery];
            IEnumerable       results  = (IEnumerable)subQuery.Execute(this.Session.Provider, parentArgs, this.Session.UserArguments).ReturnValue;

            return(results);
        }