Struct TemporaryCommandTimeout
Represents a lightweight disposable object that swaps IDbCommand timeout.
public readonly struct TemporaryCommandTimeout : IDisposable
- Implements
- Inherited Members
Constructors
TemporaryCommandTimeout(IDbCommand, TimeSpan?)
Creates a new TemporaryCommandTimeout instance.
public TemporaryCommandTimeout(IDbCommand command, TimeSpan? timeout)
Parameters
command
IDbCommandCommand to swap CommandTimeout for.
timeout
TimeSpan?Optional timeout to set. Lack of value will cause the timeout to not be changed.
Exceptions
- ArgumentException
When
timeout
is less 0.
Properties
Command
Underlying IDbCommand instance.
public IDbCommand Command { get; }
Property Value
PreviousTimeout
CommandTimeout of Command before the change.
public int PreviousTimeout { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Remarks
Sets PreviousTimeout as timeout of the Command.