title: Unnecessary conversion to bigint
body: <p>I have employee table with <code>bigint</code> primary key field in database and entity data model with database first approach. Employee class have this structure</p>
  
  <pre><code>public partial class Employee
  {
       public long Emp_No { get; set; }
       public string Name { get; set; }
       public string Family { get; set; }
       ...
  }
  </code></pre>
  
  <p>I write this basic query with Entity Framework</p>
  
  <pre><code>List&lt;long&gt; ids = new List&lt;long&gt;() {1,2,3,4,5,6}
  database.Employees.Where(q =&gt; ids.Contain(q.Emp_No)).ToList();
  </code></pre>
  
  <p>It Generate query as the following:</p>
  
  <pre><code>SELECT 
      [Extent1].[Emp_No] AS [Emp_No], 
      [Extent1].[Name] AS [Name], 
      [Extent1].[Family] AS [Family], 
      ...
      FROM [dbo].[Employee] AS [Extent1]
      WHERE [Extent1].[Emp_No] IN (cast(0 as bigint), 
                                   cast(1 as bigint), 
                                   cast(2 as bigint), 
                                   cast(3 as bigint), 
                                   cast(4 as bigint), 
                                   cast(5 as bigint), 
                                   cast(6 as bigint))
  </code></pre>
  
  <p>As you can see there is unnecessary cast to bigint in query while both type of <code>Emp_No</code> and <code>ids</code> array are <code>long</code>, It causes bad execution times specially whenever <code>ids</code> array has many elements.</p>
  
  <p>How can I remove this redundant cast?</p>