ObjectContext.CommandTimeout Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the timeout value, in seconds, for all object context operations. A null
value indicates that the default value of the underlying provider will be used.
public:
property Nullable<int> CommandTimeout { Nullable<int> get(); void set(Nullable<int> value); };
public int? CommandTimeout { get; set; }
member this.CommandTimeout : Nullable<int> with get, set
Public Property CommandTimeout As Nullable(Of Integer)
Property Value
An Int32 value that is the timeout value, in seconds.
Exceptions
The timeout value is less than 0.
Examples
Remarks
The default timeout for object queries and the SaveChanges operation is defined by the underlying connection provider. However, you can override this default timeout value by using the CommandTimeout property on ObjectContext. Do this when you have a complex query or when other performance issues cause queries or calls to SaveChanges to time out frequently.