By adding in a few code in the DBContect we can increase SQLServer Command timeout
public class WeedingContext : DbContext
{
public WeedingContext()
: base("WeddingDb")
{
// Get the ObjectContext related to this DbContext
var objectContext = (this as IObjectContextAdapter).ObjectContext;
// Sets the command timeout for all the commands
objectContext.CommandTimeout = 180;
}
No comments:
Post a Comment