0
trendline created
In my application, there will be large data be queried, sometimes it will timeout to connect database, where I can set timeout for EF core?
I tried add below property in EF Core constructor but it seems it doesn't work, and when using EF migration update database, it will failed because this change.
public MyDbContext(DbContextOptions<MyDbContext> options)
: base(options)
{
this.Database.SetCommandTimeout(180);
}
Can I set it in connection string? Hope you can give me some guides.
4 Answer(s)
-
0
Hi,
Can you try this in PrInitialize method of your module ?
Configuration.UnitOfWork.Timeout = TimeSpan.FromMinutes(3);
-
0
Add this in application module or core module?
-
0
It seems it doesn't work, it still execute the sql with default timeout 30 seconds.
-
0
Hi,
Have you tried it in your web module ?