小编Dou*_*idt的帖子

ServiceStack MiniProfiler可以显示SQL参数值,而不仅仅是绑定的参数名称吗?

我已经得到了ServiceStack MiniProfiler在我APPHOST(在的Application_Start)启用,我可以查看我的网页通过OrmLite生成的SQL.(使用SS v3.9.59.0)

不能在轮廓跟踪看到的是绑定参数的值.因此,如果OrmLite将LINQ表达式转换为@ 0,我无法看到作为查询的一部分发送到DB的值.

以下是分析器的示例跟踪:

SELECT "SettingGroup" , "SettingKey" , "LastModified" , "SettingValue"  
FROM "GlobalSetting"
WHERE (("SettingGroup" = @0) AND ("SettingKey" = 'a3849d59864b252a2022b4b8a164add1'))
Run Code Online (Sandbox Code Playgroud)

我真的很想知道@0为这个查询发送了什么值.

protected void Application_Start(object sender, EventArgs e)
{
    Profiler.Settings.SqlFormatter = new InlineFormatter(true);
    new AppHost().Init();
}
Run Code Online (Sandbox Code Playgroud)

我尝试了一些Profiler.Settings.SqlFormatter属性的变种:

  • SqlFormatter = new InlineFormatter();
  • SqlFormatter = new InlineFormatter(true);
  • SqlFormatter = new SqlServerFormatter();
  • 根本不设置SqlFormatter,将其保留为默认值

所有这些都有相同的结果,只显示@0但不显示其价值.

如果单击"共享"链接,我可以在生成的JSON数组中看到绑定参数名称及其值.我只是在渲染的探查器输出中看不到它.

有什么想法,我需要做什么来显示参数值?

servicestack mvc-mini-profiler ormlite-servicestack

8
推荐指数
1
解决办法
1131
查看次数