Ejemplo n.º 1
0
        public IncludeGraph(Expression expression)
        {
            var node = new IncludeNode
            {
                Expression = expression,
                Graph      = this
            };

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


            _current = node;

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