Exemple #1
0
        protected void logPush(SemanticItem item)
        {
            if (_queryLog.Count == 0)
            {
                //logging is not enabled
                return;
            }

            Log.QueryPush(item);

            var peek = _queryLog.Peek();

            if (peek.Query == item)
            {
                _queryLog.Push(peek);
            }
            else
            {
                var log = new QueryLog(item);
                if (_expectDependencyQuery)
                {
                    log.IsDependency       = true;
                    _expectDependencyQuery = false;
                }

                peek.AddSubquery(log);
                _queryLog.Push(log);
            }
        }
Exemple #2
0
        internal void AddSubquery(QueryLog subquery)
        {
            if (subquery.Parent != null)
            {
                throw new InvalidOperationException("Cannot reset parent.");
            }

            if (subquery == this)
            {
                throw new InvalidOperationException("Cannot set self as a parent.");
            }

            subquery.Parent = this;

            if (subquery.IsDependency)
            {
                _dependencyQueries.Add(subquery);
            }
            else
            {
                _subqueries.Add(subquery);
            }
        }