public IncludeGraph(Expression expression) { var node = new IncludeNode { Expression = expression, Graph = this }; Root = node; ScriptToNodes = new Dictionary <IDbObject, IncludeNode>(); }
public void AddInclude(Expression expression) { var node = new IncludeNode { Expression = expression, Graph = this }; _current = node; Root.AddToNode(_current); }
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; }
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; }