默认的实体框架超时 [英] Default Entity Framework timeout

查看:171
本文介绍了默认的实体框架超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是EF查询的默认超时?我试着通过检查 context.CommandTimeout 找出来,但它返回

What is the default timeout for EF queries? I've tried to find out by checking context.CommandTimeout, but it returns null.

我也期待在像连接超时= 在连接字符串中的web配置,但它似乎并没有在那里在默认情况下。

I have also looked in the web config in the connection string for something like Connect Timeout=, but it doesn't seem to be there by default.

推荐答案

有关对象查询的默认超时和调用SaveChanges操作是由底层连接提供者定义。由于实体框架,可用于多种连接提供商,MySQL和SQL服务器等,并都具有不同的默认的超时的!

The default timeout for object queries and the SaveChanges operation is defined by the underlying connection provider. Since Entity Framework can be used for many connection providers, mysql, sql server etc. and all have different default timeout's!

所以表示默认超时将被使用,如果你想知道什么是默认的,然后它取决于你所使用的连接提供商!

So null means default timeout will be used, if you want to know what is the default then it depends on the connection provider you are using!

这篇关于默认的实体框架超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆