예제 #1
0
        private static TreeNode CreateParametersNode(DbCommandTree tree)
        {
            var retNode = new TreeNode("Parameters");

            foreach (var paramInfo in tree.Parameters)
            {
                var paramNode = new TreeNode(paramInfo.Key);
                PrinterVisitor.AppendTypeSpecifier(paramNode, paramInfo.Value);
                retNode.Children.Add(paramNode);
            }

            return(retNode);
        }
예제 #2
0
        internal string Print(DbQueryCommandTree tree)
        {
            DebugCheck.NotNull(tree);

            var queryNode = new TreeNode("Query");

            if (tree.Query != null)
            {
                PrinterVisitor.AppendTypeSpecifier(queryNode, tree.Query.ResultType);
                queryNode.Children.Add(_visitor.VisitExpression(tree.Query));
            }

            return(Print(new TreeNode("DbQueryCommandTree", CreateParametersNode(tree), queryNode)));
        }
예제 #3
0
        internal string Print(DbFunctionCommandTree tree)
        {
            DebugCheck.NotNull(tree);

            var funcNode = new TreeNode("EdmFunction");

            if (tree.EdmFunction != null)
            {
                funcNode.Children.Add(_visitor.VisitFunction(tree.EdmFunction, null));
            }

            var typeNode = new TreeNode("ResultType");

            if (tree.ResultType != null)
            {
                PrinterVisitor.AppendTypeSpecifier(typeNode, tree.ResultType);
            }

            return(Print(new TreeNode("DbFunctionCommandTree", CreateParametersNode(tree), funcNode, typeNode)));
        }
예제 #4
0
        internal string Print(DbFunctionCommandTree tree)
        {
            Debug.Assert(tree != null, "Null DbFunctionCommandTree");

            TreeNode funcNode = new TreeNode("EdmFunction");

            if (tree.EdmFunction != null)
            {
                funcNode.Children.Add(_visitor.VisitFunction(tree.EdmFunction, null));
            }

            TreeNode typeNode = new TreeNode("ResultType");

            if (tree.ResultType != null)
            {
                PrinterVisitor.AppendTypeSpecifier(typeNode, tree.ResultType);
            }

            return(this.Print(new TreeNode("DbFunctionCommandTree", CreateParametersNode(tree), funcNode, typeNode)));
        }