title: How to use parameters in Entity Framework in a "in" clause?
body: <p>I am using Entity Framework 4.0 and I want to use the following query:</p>
  
  <p>To do that I do the following:</p>
  
  <pre><code>strSQLQuery = "select * from MyTable where IDData IN (@IDs)";
  lstParameters.Clear();
  myParameter = new SqlParameter("@IDs", strIDs);
  lstParameters.Add(myParameter);
  
  myContext.MyTable.SqlQuery(strSQLQuery, lstParameters.ToArray&lt;object&gt;()).ToList&lt;MyTable&gt;();
  </code></pre>
  
  <p>But I get an exception that say that it is not possible to convert <code>nvarchar</code> to <code>bigint</code>.</p>
  
  <p>That is because the parameter is the type string, and the IDs in the table are <code>bigint</code>.</p>
  
  <p>I try to create a list of long and add some IDs, but I get other error.</p>
  
  <p>How can I use a list o IDs as parameter in a query?</p>
  
  <p>I would like to use parameters, if that is possible.</p>
  
  <p>Thanks.</p>