如何从Simple.Data ORM for .NET中记录生成的sql查询

nid*_*das 8 .net simple.data

如何记录生成的sql查询(没有mysql profiler)?

我正在使用Simple.Data.Mysql

Dan*_*rry 13

你有几个选择.您可以设置这样的跟踪侦听器,然后它将显示在VS输出窗口中.

<configuration>
   <system.diagnostics>
      <switches>
         <add name="Simple.Data" value="Info" />
      </switches>
   </system.diagnostics>
</configuration>
Run Code Online (Sandbox Code Playgroud)

或者您也可以查看Simple.Data.Sample中的ExampleRunnerExampleTestListener类,以获取在代码中设置它的示例.

  • 在最近的版本中,您需要在值中编写信息.请参阅此行https://groups.google.com/forum/#!searchin/simpledata/trace/simpledata/xKQyUWLqa1Y/PwOqX1znzvwJ (3认同)