コード例 #1
0
        // Constructors

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

            this.compiledStatement = compiledStatement;
            ParameterBindings      = ParameterBinding.NormalizeBindings(parameterBindings);
        }
コード例 #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;
        }
コード例 #3
0
        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;
        }
コード例 #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");
            }
        }