// Constructors

        public UserQueryRequest(SqlCompilationResult compiledStatement, IEnumerable <QueryParameterBinding> parameterBindings)
        {
            ArgumentValidator.EnsureArgumentNotNull(compiledStatement, "compiledStatement");
            ArgumentValidator.EnsureArgumentNotNull(parameterBindings, "parameterBindings");

            this.compiledStatement = compiledStatement;
            ParameterBindings      = ParameterBinding.NormalizeBindings(parameterBindings);
        }
Esempio n. 2
0
        // Constructors

        public QueryRequest(
            StorageDriver driver, SqlSelect statement, IEnumerable <QueryParameterBinding> parameterBindings,
            TupleDescriptor tupleDescriptor, QueryRequestOptions options)
        {
            ArgumentValidator.EnsureArgumentNotNull(driver, "driver");
            ArgumentValidator.EnsureArgumentNotNull(statement, "statement");
            ArgumentValidator.EnsureArgumentNotNull(tupleDescriptor, "tupleDescriptor");

            this.driver       = driver;
            Statement         = statement;
            ParameterBindings = ParameterBinding.NormalizeBindings(parameterBindings);
            TupleDescriptor   = tupleDescriptor;
            Options           = options;
        }
        public PersistRequest(
            StorageDriver driver, SqlStatement statement, IEnumerable <PersistParameterBinding> parameterBindings, NodeConfiguration nodeConfiguration)
        {
            ArgumentValidator.EnsureArgumentNotNull(driver, "driver");
            ArgumentValidator.EnsureArgumentNotNull(statement, "statement");

            var compileUnit = statement as ISqlCompileUnit;

            if (compileUnit == null)
            {
                throw new ArgumentException("Statement is not ISqlCompileUnit");
            }

            this.driver       = driver;
            Statement         = statement;
            CompileUnit       = compileUnit;
            ParameterBindings = ParameterBinding.NormalizeBindings(parameterBindings);
            NodeConfiguration = nodeConfiguration;
        }
Esempio n. 4
0
        private void AddParameter(
            CommandPart commandPart, ParameterBinding binding, string parameterName, object parameterValue)
        {
            switch (binding.TransmissionType)
            {
            case ParameterTransmissionType.Regular:
                AddRegularParameter(commandPart, binding.TypeMapping, parameterName, parameterValue);
                break;

            case ParameterTransmissionType.CharacterLob:
                AddCharacterLobParameter(commandPart, parameterName, (string)parameterValue);
                break;

            case ParameterTransmissionType.BinaryLob:
                AddBinaryLobParameter(commandPart, parameterName, (byte[])parameterValue);
                break;

            default:
                throw new ArgumentOutOfRangeException("binding.BindingType");
            }
        }