Set Command Timeout in EF 6
30,014
Check this :
Entity Framework 6 :
this.context.Database.CommandTimeout = 180;
Entity Framework 5:
((IObjectContextAdapter)this.context).ObjectContext.CommandTimeout = 180;
Entity Framework 4 and below:
this.context.CommandTimeout = 180;
Related videos on Youtube
Comments
-
Ali about 4 years
I want to set command timeout for query execution, currently I am doing
context.Database.CommandTimeout = 90;
but i feel this is not working, I tried checking the process logs in database but found the time difference was always less than 90sec.Can someone help how can I set the database timeout in Entity Framework 6?
-
Dilip Oganiya almost 8 yearsFollow this post for more clarity: stackoverflow.com/questions/6232633/entity-framework-timeout‌​s
-
-
Zeek2 about 3 yearsThanks. That fixed many occurrences of this build error for me: Upgrading from Entity Framework 5 to EF6 Error BC30456 "'CommandTimeout' is not a member of"
-
T M almost 3 yearsFor EF 6.2 at least this needs to be placed in Configuration class in the migrations folder in the constructor: public Configuration(){ CommandTimeout = 3600; }