My command keeps timing out, so I need to change the default command timeout value.
I\'ve found myDb.Database.Connection.ConnectionTimeout, but it\'s
Try this on your context:
public class MyDatabase : DbContext
{
public MyDatabase ()
: base(ContextHelper.CreateConnection("Connection string"), true)
{
((IObjectContextAdapter)this).ObjectContext.CommandTimeout = 180; // seconds
}
}
If you want to define the timeout in the connection string, use the Connection Timeout parameter like in the following connection string:
Source: How to: Define the Connection String