Esempio n. 1
0
        public override void SetParameterValue(DbCommand command, string parameterName, object value)
        {
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }
            object obj = value;
            ParameterTypeRegistry parameterTypeRegistry = this.GetParameterTypeRegistry(command.CommandText);

            if (parameterTypeRegistry != null && parameterTypeRegistry.HasRegisteredParameterType(parameterName) && DbType.Guid == parameterTypeRegistry.GetRegisteredParameterType(parameterName))
            {
                obj = OracleDatabase.ConvertGuidToByteArray(value);
            }
            base.SetParameterValue(command, parameterName, obj);
        }
Esempio n. 2
0
 public override void AddParameter(
     DbCommand command,
     string name,
     DbType dbType,
     int size,
     ParameterDirection direction,
     bool nullable,
     byte precision,
     byte scale,
     string sourceColumn,
     DataRowVersion sourceVersion,
     object value)
 {
     if (DbType.Guid.Equals((object)dbType))
     {
         object byteArray = OracleDatabase.ConvertGuidToByteArray(value);
         this.AddParameter((OracleCommand)command, name, OracleType.Raw, 16, direction, nullable, precision, scale, sourceColumn, sourceVersion, byteArray);
         this.RegisterParameterType(command, name, dbType);
     }
     else
     {
         base.AddParameter(command, name, dbType, size, direction, nullable, precision, scale, sourceColumn, sourceVersion, value);
     }
 }