How to add CommandTimeout to connection string in web.config
I made it like this:
private readonly MyDbContext _context;
public LinqToSql() : this(new MyDbContext())
{
}
private LinqToSql(MyDbContext context)
{
_context = context;
_context.CommandTimeout = 500;
}
As far as I know there is no global way of setting Command timeout property, you have to set CommandTimeout property individually for each command object you create.