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

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


            _current = node;

            Root.AddToNode(_current);
        }
Example #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;
        }
Example #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));
            }
        }
Example #5
0
 public void AddToNode(IncludeNode node)
 {
     _toNodes.Add(node);
     node.FromNode = this;
 }