예제 #1
0
파일: Table.cs 프로젝트: stalinvr007/VoDB
 private void SetKeysAsParameters(String prefix, IVodbCommand command)
 {
     command.SetParametersNames(Keys.Select(k => GetParameterName(prefix, k)).ToArray());
 }
예제 #2
0
파일: Table.cs 프로젝트: stalinvr007/VoDB
        public IVodbCommand GetUpdateCommand(IVodbCommandFactory factory)
        {
            if (_UpdateCommand != null) { return _UpdateCommand; }

            _UpdateCommand = factory.MakeCommand(SqlUpdate);
            SetFieldsAsParameters(PARAMETER_PREFIX, _UpdateCommand);
            SetKeysAsParameters(PARAMETER_PREFIX_OLD, _UpdateCommand);

            return _UpdateCommand;
        }
예제 #3
0
파일: Table.cs 프로젝트: stalinvr007/VoDB
 private void SetFieldsAsParameters(String prefix, IVodbCommand command)
 {
     command.SetParametersNames(Fields.Where(f => !f.IsIdentity).Select(k => GetParameterName(prefix, k)).ToArray());
 }
예제 #4
0
파일: Table.cs 프로젝트: stalinvr007/VoDB
        public IVodbCommand GetSelectByIdCommand(IVodbCommandFactory factory)
        {
            if (_SelectByIdCommand != null) { return _SelectByIdCommand; }

            _SelectByIdCommand = factory.MakeCommand(SqlSelectById);
            SetKeysAsParameters(PARAMETER_PREFIX, _SelectByIdCommand);

            return _SelectByIdCommand;
        }
예제 #5
0
파일: Table.cs 프로젝트: stalinvr007/VoDB
        public IVodbCommand GetSelectAllCommand(IVodbCommandFactory factory)
        {
            if (_SelectCommand != null) { return _SelectCommand; }

            return _SelectCommand = factory.MakeCommand(SqlSelect);
        }
예제 #6
0
파일: Table.cs 프로젝트: stalinvr007/VoDB
        public IVodbCommand GetInsertCommand(IVodbCommandFactory factory)
        {
            if (_InsertCommand != null) { return _InsertCommand; }

            _InsertCommand = factory.MakeCommand(SqlInsert);
            SetFieldsAsParameters(PARAMETER_PREFIX, _InsertCommand);

            return _InsertCommand;
        }
예제 #7
0
파일: Table.cs 프로젝트: stalinvr007/VoDB
        public IVodbCommand GetDeleteCommand(IVodbCommandFactory factory)
        {
            if (_DeleteCommand != null) { return _DeleteCommand; }

            _DeleteCommand = factory.MakeCommand(SqlDeleteById);
            SetKeysAsParameters(PARAMETER_PREFIX, _DeleteCommand);

            return _DeleteCommand;
        }
예제 #8
0
파일: Table.cs 프로젝트: stalinvr007/VoDB
        public IVodbCommand GetCountCommand(IVodbCommandFactory factory)
        {
            if (_CountCommand != null) { return _CountCommand; }

            return _CountCommand = factory.MakeCommand(SqlCount);
        }