首先NuGet添加 相对应ef版本的Miniprofiler.ef引用

web.config文件中添加

<system.webServer>
<handlers> 
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
</system.webServer>

Global 文件中添加

protected void Application_Start(object sender, EventArgs e)
{

StackExchange.Profiling.EntityFramework6.MiniProfilerEF6.Initialize();

}
protected void Application_BeginRequest(object sender, EventArgs e)
{
if (Request.IsLocal)
{
MiniProfiler.Start();
}
}
protected void Application_EndRequest(object sender, EventArgs e)
{
MiniProfiler.Stop();
}

在需要监控的webfrom页面中增加

protected override void OnPreRender(EventArgs e)
{
Response.Write(StackExchange.Profiling.MiniProfiler.RenderIncludes());
base.OnPreRender(e);
}

运行页面

点击share 查看详细信息

以上就是MiniProfiler 监控webfrom中使用ef操作过程。

最新文章

  1. [C#6] 5-自动属性增强
  2. SqlServer环境配置和卸载
  3. Javascript写俄罗斯方块游戏
  4. meeting room I &amp; II
  5. [javaSE] 练习队列线程和对象序列化
  6. 关于Block Formatting Context--BFC和IE的hasLayout
  7. POS机刷卡失败的郁闷事
  8. Android——获取网络图片
  9. How to: Reading an ini config file from a batch file
  10. Bag of Words/Bag of Features的Matlab源码发布
  11. FTP服务添加用户及设置权限
  12. Oracle客户端安装教程
  13. android 调用 screenrecord 实现录屏
  14. linux设置环境变量(这里以hive为例给大家举例)
  15. SQLite multiple threads
  16. (1.5)MySQL表的5种分区类型
  17. dedecms(织梦系统)如何更新手机版首页模板文件
  18. overflow visibility opacity(透明度) vertical-align 等等
  19. java go
  20. TQ2440开发板挂载U盘出现乱码

热门文章

  1. kill 掉 占据端口的进程
  2. Amazon SQS 消息队列服务
  3. [转帖]MyCat教程【简单介绍】
  4. Bean配置
  5. FZU2018级算法第三次作业 3.16 station
  6. Linux下实现web服务器
  7. mouseover mouseleave
  8. DO、VO、DTO 区别
  9. ABP 基于DDD的.NET开发框架 学习(二)创建实体
  10. [JZOJ5280]膜法师题解--思维+前缀和