# EF6 DbContext.ExecuteSqlCommand not profiling

**URL:** <https://community.miniprofiler.com/t/ef6-dbcontext-executesqlcommand-not-profiling/319>\
**Category:** .NET\
**Created:** [September 4, 2014, 6:02pm UTC](https://community.miniprofiler.com/t/ef6-dbcontext-executesqlcommand-not-profiling/319 "2014-09-04T18:02:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidleefox](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/davidleefox/32/817_2.png) [@davidleefox](https://community.miniprofiler.com/u/davidleefox)\
**Post date:** [September 4, 2014, 6:02pm UTC](https://community.miniprofiler.com/t/ef6-dbcontext-executesqlcommand-not-profiling/319/1 "2014-09-04T18:02:16Z")

</div>

Using MiniProfiler, MiniProfiler.EF6 and MiniProfiler.MVC4 packages. Explicitly wrapping steps and custom timings is working as expected, but raw SQL execution isn’t being picked up e.g.

```
var context = new MyContext(userIdentity);
var sql = "select * from customers where customer_id = @customer_id";
var param = new SqlParameter("customer_id", System.Data.SqlDbType.Int);
param.Value = 123;
context.Database.ExecuteSqlCommand(sql, param);

```

Using latest version of all specified packages. I seem to remember this automatically working in the past, but maybe an update broke it?

```
// called when app starts
MiniProfilerEF6.Initialize(); 
// handles profiling based on cookie, etc
DynamicModuleUtility.RegisterModule(typeof(Modules.MiniProfilerStartupModule));
```

---

<div class="post-metadata">

**Author:** ![Yaakov\_Ellis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/yaakov_ellis/32/961_2.png) [@Yaakov\_Ellis](https://community.miniprofiler.com/u/Yaakov_Ellis)\
**Post date:** [September 23, 2014, 7:06pm UTC](https://community.miniprofiler.com/t/ef6-dbcontext-executesqlcommand-not-profiling/319/2 "2014-09-23T19:06:21Z")

</div>

Works for me without issues. Current nugets. Can you remember what change in your app broke this?
