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.
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
4 Answer(s)
-
0
Hi,
Can you try this in PrInitialize method of your module ?
Configuration.UnitOfWork.Timeout = TimeSpan.FromMinutes(3);Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Add this in application module or core module?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
It seems it doesn't work, it still execute the sql with default timeout 30 seconds.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi,
Have you tried it in your web module ?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)