渲染时取消LinqPad查询 [英] Cancel a LinqPad query while it renders

查看:115
本文介绍了渲染时取消LinqPad查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每隔一段时间,当我编写LinqPad查询时,我会忘记一些数据库对象的复杂性. 这可能会导致查询快速运行(<5秒),但是需要更长的时间(> 5分钟)才能将结果呈现到输出窗口.在这种情况下,整个LinqPad UI都变得无响应.

Every now and then when I write LinqPad queries I forget how complex some of my database objects are. This can result in a query that runs quickly (< 5 secs) but then takes longer (>5 mins) to render the results to the output window. While this is happening the entire LinqPad UI becomes unresponsive.

您可以使用停止"按钮在查询从数据库返回之前取消查询,但是如果我觉得结果集花费的时间太长,是否可以取消结果集的呈现?

You can cancel a query before it returns from the DB using the 'stop' button, but is there a way to cancel the rendering of the result set if I feel that it is taking too long?

我认为,如果使用.Dump(int depth)重载,这可能会减少许多表关系中涉及的呈现,但是我很快意识到这是默认情况下完成的. (即使这样,您也必须记住始终使用此功能)

I thought that if I used the .Dump(int depth) overload, that this might reduce the rendering involved in numerous table relationships, but I quickly realized that this is done by default. (even so you'd have to remember to always use this)

除了杀死linqpad或等待它返回之前,是否还有其他更优雅的取消渲染操作的方法?

Is there some more elegant way of cancelling the rendering operation, other than killing linqpad or waiting for it to come back?

推荐答案

我已重现了您描述的问题. LINQPad UI暂时变得无响应,并且当显示结果的嵌入式WebBrowser控件被分配给一个大而复杂的文档来解决时,就会发生这种情况.

I've reproduced the problem you describe. The LINQPad UI becomes temporarily unresponsive, and this occurs when the embedded WebBrowser control which displays the results is given a large and complex document to resolve.

此问题应从v4.50.02版本开始解决(在撰写本文时,测试版). LINQPad现在在呈现对象图时跟踪访问的对象总数.超过阈值时,嵌套深度会自动回退,使生成的HTML足够小,以使WebBrowser第一次渲染时不应冻结超过一两秒钟.

This should be resolved as of v4.50.02 (in beta at time of writing). LINQPad now keeps track of the total number of objects visited when rendering the object graph. Upon exceeding a threshold, the nesting depth is automatically wound back, keeping the resultant HTML small enough that the WebBrowser shouldn't freeze for more than a second or two when first rendering.

这篇关于渲染时取消LinqPad查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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