更新时间:2023-02-26 17:33:55
连接超时控制应用程序等待建立数据库连接的时间。它对应用程序等待数据库查询执行的时间没有影响。
您需要更改context.Database.CommandTimeout
属性改为:
Database.CommandTimeout属性(System.Data.Entity) [ ^ ]
The connection timeout controls how long your application will wait for a database connection to be established. It has no effect on how long the application will wait for a database query to execute.
You need to change thecontext.Database.CommandTimeout
property instead:
Database.CommandTimeout Property (System.Data.Entity)[^]