如何登录生成的SQL查询出Simple.Data ORM的.NET [英] How to log generated sql queries out of Simple.Data ORM for .NET

查看:208
本文介绍了如何登录生成的SQL查询出Simple.Data ORM的.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何登录生成的SQL查询(不包括MySQL的探查)?

How to log generated sql queries (without mysql profiler)?

我用Simple.Data.Mysql

I'm using Simple.Data.Mysql

推荐答案

您有几个选择这里。您可以设置一个跟踪侦听这样的,然后是的,它会在VS输出窗口中显示出来。

You have a couple of choices here. You can either set up a trace listener like this and then yes it will show up in the VS output window.

<configuration>
   <system.diagnostics>
      <switches>
         <add name="Simple.Data" value="Info" />
      </switches>
   </system.diagnostics>
</configuration>

或者,你也可以看看的<一个href="https://github.com/markrendle/Simple.Data.Sample/blob/master/SimpleDataSample/ExampleRunner.cs">ExampleRunner和<一href="https://github.com/markrendle/Simple.Data.Sample/blob/master/SimpleDataSample/ExampleTestListener.cs">ExampleTestListener类Simple.Data.Sample设置它在code的一个例子。

Or you can also have a look at the ExampleRunner and ExampleTestListener classes in Simple.Data.Sample for an example of setting it up in code.

这篇关于如何登录生成的SQL查询出Simple.Data ORM的.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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