Esempio n. 1
0
            internal override SqlStoredProcedureCall VisitStoredProcedureCall(SqlStoredProcedureCall spc)
            {
                List <SqlExpression> args = new List <SqlExpression>(spc.Arguments.Count);

                foreach (SqlExpression expression in spc.Arguments)
                {
                    args.Add(this.VisitExpression(expression));
                }
                SqlExpression          projection = this.VisitExpression(spc.Projection);
                SqlStoredProcedureCall call       = new SqlStoredProcedureCall(spc.Function, projection, args, spc.SourceExpression);

                this.nodeMap[spc] = call;
                foreach (SqlUserColumn column in spc.Columns)
                {
                    call.Columns.Add((SqlUserColumn)this.Visit(column));
                }
                return(call);
            }
Esempio n. 2
0
            internal override SqlStoredProcedureCall VisitStoredProcedureCall(SqlStoredProcedureCall spc)
            {
                var returnType = spc.Function.Method.ReturnType;

                if (returnType != typeof(void))
                {
                    var parameter3 = new SqlParameter(returnType,
                                                      parameterizer.TypeProvider.From(returnType),
                                                      "@RETURN_VALUE", spc.SourceExpression)
                    {
                        Direction = ParameterDirection.Output
                    };
                    this.currentParams.Add(new SqlParameterInfo(parameter3));
                }

                this.VisitUserQuery(spc);
                int num   = 0;
                int count = spc.Function.Parameters.Count;

                while (num < count)
                {
                    MetaParameter p    = spc.Function.Parameters[num];
                    var           node = spc.Arguments[num] as SqlParameter;
                    if (node != null)
                    {
                        node.Direction = GetParameterDirection(p);
                        node.Name      = p.MappedName.StartsWith("@") ? p.MappedName : "@" + p.MappedName;
                        if ((node.Direction == ParameterDirection.InputOutput) ||
                            (node.Direction == ParameterDirection.Output))
                        {
                            RetypeOutParameter(node);
                        }
                    }
                    num++;
                }
                //var parameter3 = new SqlParameter(typeof(int?),
                //                                  parameterizer.TypeProvider.From(typeof(int)),
                //                                  "@RETURN_VALUE", spc.SourceExpression) { Direction = ParameterDirection.Output };
                //currentParams.Add(new SqlParameterInfo(parameter3));

                return(spc);
            }
Esempio n. 3
0
        internal virtual SqlStoredProcedureCall VisitStoredProcedureCall(SqlStoredProcedureCall spc)
        {
            int num   = 0;
            int count = spc.Arguments.Count;

            while (num < count)
            {
                spc.Arguments[num] = this.VisitExpression(spc.Arguments[num]);
                num++;
            }
            spc.Projection = this.VisitExpression(spc.Projection);
            int num3 = 0;
            int num4 = spc.Columns.Count;

            while (num3 < num4)
            {
                spc.Columns[num3] = (SqlUserColumn)this.Visit(spc.Columns[num3]);
                num3++;
            }
            return(spc);
        }