I'm trying to access ObjectContext
to be able to increase the CommandTimeout
using WCF RIA / EF5
protected override MyEntities CreateDbContext()
{
var dbContext = base.CreateDbContext();
// returns a null ref
// Get the ObjectContext related to this DbContext
var objectContext = (this as IObjectContextAdapter).ObjectContext;
objectContext.CommandTimeout = 120;
return dbContext;
}
This doesn't work.
Currently the EF timeout is 30secs.