给Entity Framework添加执行的超时时间

可以写一个部分类

public partial class eBuulMCEntities 



{ 



    public eBuulMCEntities(int? commandTimeout)  : base("name=eBuulMCEntities")       



    {             // Get the ObjectContext related to this DbContext             



                 var objectContext = (this as IObjectContextAdapter).ObjectContext; 



                 // Sets the command timeout for all the commands             



                 objectContext.CommandTimeout = commandTimeout;      



     }  



} 

 

你可能感兴趣的:(framework)