I want all normal commands to have default timeout of 30 sec, but for one stored proc I need 5 min.
I don't want do this this unless it's the only way.
public partial class AContext : DbContext
{
public AContext(string connectionString)
: base(connectionString)
{
((IObjectContextAdapter)this).ObjectContext.CommandTimeout = 300;
}
}
How to attach timeout to this query only?
Context.Database.SqlQuery<AAAAA>("usp_AAAAA");