public SharedStoredProcedure(Expression <Func <TDatabase, IQueryable <TResult> > > expression)
        {
            this.expression = expression.Body;

            // Create parameter description
            this.SetParameters(
                StoredProcedureParameterSearchVisitor
                .FindParameters(this.expression)
                .Select(p => new ParameterDescription(p.Name, p.Type)));
        }
Пример #2
0
        public StoredProcedure(IQueryable <T> query, bool precompile)
        {
            IDatabase  database   = ((ITableQuery)query).Database;
            Expression expression = query.Expression;

            // Set parameter description
            this.SetParameters(
                StoredProcedureParameterSearchVisitor
                .FindParameters(expression)
                .Select(p => new ParameterDescription(p.Name, p.Type)));

            this.query = new TableQuery <T>(database, expression, precompile);

            if (precompile)
            {
                this.query.Compile();
            }
        }