Exemple #1
0
        public IncludeGraph(Expression expression)
        {
            var node = new IncludeNode
            {
                Expression = expression,
                Graph      = this
            };

            Root          = node;
            ScriptToNodes = new Dictionary <IDbObject, IncludeNode>();
        }
Exemple #2
0
        public void AddInclude(Expression expression)
        {
            var node = new IncludeNode
            {
                Expression = expression,
                Graph      = this
            };


            _current = node;

            Root.AddToNode(_current);
        }
Exemple #3
0
        public void AddThenInclude(Expression expression)
        {
            var node = new IncludeNode
            {
                Expression = expression,
                Graph      = this
            };

            if (_current == null)
            {
                _current = node;
                Root.AddToNode(_current);
                return;
            }

            _current.AddToNode(node);
            _current = node;
        }
Exemple #4
0
        private static void UpdateScript(IncludeNode node, IDbScript script, IDbObjectFactory dbFactory)
        {
            if (node.TempTable != null)
            {
                script.Scripts.Add(node.TempTable.GetCreateStatement(dbFactory));
            }

            script.Scripts.Add(node.Select);

            foreach (var toNode in node.ToNodes)
            {
                UpdateScript(toNode, script, dbFactory);
            }

            if (node.TempTable != null)
            {
                script.Scripts.Add(node.TempTable.GetDropStatement(dbFactory));
            }
        }
 public void AddToNode(IncludeNode node)
 {
     _toNodes.Add(node);
     node.FromNode = this;
 }