title: Entity Framework (5) View parameters passed to generated SQL
body: <p>How do I view the parameters (Bind Variables) passed to the generated SQL command created by Entity Framework (V5)?</p>
  
  <pre><code>public IEnumerable&lt;SearchItem&gt; Search(string searchTerm)
  {
      return DbSet.Where(p =&gt; p.ItemId.Contains(searchTerm)).ToList();
  }
  </code></pre>
  
  <p>The code above generated the following SQL and includes the bind variable <code>__linq__0</code></p>
  
  <pre><code>SELECT 
       "Extent1"."ITEM" AS "ITEM", 
  FROM "TableName" "Extent1"
  WHERE UPPER("Extent1"."ITEM") LIKE :p__linq__0
  </code></pre>
  
  <p>How do I debug and view the value of this bind variable when debugging?
  I have seen answers which suggested enabling tracing, but there must be a way of checking these values in the Visual Studio debugger.</p>
  
  <p>Thanks.</p>