|
| 1 | +using System.Data; |
| 2 | +using System.Data.Common; |
| 3 | + |
| 4 | +namespace NHibernate.AdoNet |
| 5 | +{ |
| 6 | + /// <summary> |
| 7 | + /// A <see cref="DbCommand"/> wrapper that implements the required members. |
| 8 | + /// </summary> |
| 9 | + internal partial class DbCommandWrapper : DbCommand |
| 10 | + { |
| 11 | + public DbCommandWrapper(DbCommand command) |
| 12 | + { |
| 13 | + Command = command; |
| 14 | + } |
| 15 | + |
| 16 | + /// <summary> |
| 17 | + /// The wrapped command. |
| 18 | + /// </summary> |
| 19 | + public DbCommand Command { get; } |
| 20 | + |
| 21 | + /// <inheritdoc /> |
| 22 | + public override void Cancel() |
| 23 | + { |
| 24 | + Command.Cancel(); |
| 25 | + } |
| 26 | + |
| 27 | + /// <inheritdoc /> |
| 28 | + public override int ExecuteNonQuery() |
| 29 | + { |
| 30 | + return Command.ExecuteNonQuery(); |
| 31 | + } |
| 32 | + |
| 33 | + /// <inheritdoc /> |
| 34 | + public override object ExecuteScalar() |
| 35 | + { |
| 36 | + return Command.ExecuteScalar(); |
| 37 | + } |
| 38 | + |
| 39 | + /// <inheritdoc /> |
| 40 | + public override void Prepare() |
| 41 | + { |
| 42 | + Command.Prepare(); |
| 43 | + } |
| 44 | + |
| 45 | + /// <inheritdoc /> |
| 46 | + public override string CommandText |
| 47 | + { |
| 48 | + get => Command.CommandText; |
| 49 | + set => Command.CommandText = value; |
| 50 | + } |
| 51 | + |
| 52 | + /// <inheritdoc /> |
| 53 | + public override int CommandTimeout |
| 54 | + { |
| 55 | + get => Command.CommandTimeout; |
| 56 | + set => Command.CommandTimeout = value; |
| 57 | + } |
| 58 | + |
| 59 | + /// <inheritdoc /> |
| 60 | + public override CommandType CommandType |
| 61 | + { |
| 62 | + get => Command.CommandType; |
| 63 | + set => Command.CommandType = value; |
| 64 | + } |
| 65 | + |
| 66 | + /// <inheritdoc /> |
| 67 | + public override UpdateRowSource UpdatedRowSource |
| 68 | + { |
| 69 | + get => Command.UpdatedRowSource; |
| 70 | + set => Command.UpdatedRowSource = value; |
| 71 | + } |
| 72 | + |
| 73 | + /// <inheritdoc /> |
| 74 | + protected override DbConnection DbConnection |
| 75 | + { |
| 76 | + get => Command.Connection; |
| 77 | + set => Command.Connection = value; |
| 78 | + } |
| 79 | + |
| 80 | + /// <inheritdoc /> |
| 81 | + protected override DbParameterCollection DbParameterCollection => Command.Parameters; |
| 82 | + |
| 83 | + /// <inheritdoc /> |
| 84 | + protected override DbTransaction DbTransaction |
| 85 | + { |
| 86 | + get => Command.Transaction; |
| 87 | + set => Command.Transaction = value; |
| 88 | + } |
| 89 | + |
| 90 | + /// <inheritdoc /> |
| 91 | + public override bool DesignTimeVisible |
| 92 | + { |
| 93 | + get => Command.DesignTimeVisible; |
| 94 | + set => Command.DesignTimeVisible = value; |
| 95 | + } |
| 96 | + |
| 97 | + /// <inheritdoc /> |
| 98 | + protected override DbParameter CreateDbParameter() |
| 99 | + { |
| 100 | + return Command.CreateParameter(); |
| 101 | + } |
| 102 | + |
| 103 | + /// <inheritdoc /> |
| 104 | + protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior) |
| 105 | + { |
| 106 | + return Command.ExecuteReader(behavior); |
| 107 | + } |
| 108 | + } |
| 109 | +} |
0 commit comments