Share via


RelationalDbContextOptionsBuilder<TBuilder,TExtension>.CommandTimeout Method

Definition

Configures the wait time (in seconds) before terminating the attempt to execute a command and generating an error.

public virtual TBuilder CommandTimeout (int? commandTimeout);
abstract member CommandTimeout : Nullable<int> -> 'Builder
override this.CommandTimeout : Nullable<int> -> 'Builder
Public Overridable Function CommandTimeout (commandTimeout As Nullable(Of Integer)) As TBuilder

Parameters

commandTimeout
Nullable<Int32>

The time in seconds to wait for the command to execute.

Returns

TBuilder

The same builder instance so that multiple calls can be chained.

Remarks

This sets the CommandTimeout property on the ADO.NET provider being used.

An ArgumentException is generated if commandTimeout value is less than 0.

Zero (0) typically means no timeout will be applied, consult your ADO.NET provider documentation.

See Connections and connection strings for more information and examples.

Applies to