Entity Framework 5 如何增加 DB連線的TimeOut時間,設定方式如下



需要針對進來的context 去做設定,網路上很多寫法,試了很久,才找到方式。

[code lang=CSharp]
(this._context as System.Data.Entity.Infrastructure.IObjectContextAdapter).ObjectContext.CommandTimeout = 時間;
[/code]

參考資料:
Set database timeout in Entity Framework

Orignal From: [C#]Entity Framework 5 增加TimeOut時間

arrow
arrow
    全站熱搜

    Empty 發表在 痞客邦 留言(0) 人氣()