title: Create a Tuple in a Linq Select
body: <p>I'm working with C# and .NET Framework 4.5.1 retrieving data from a SQL Server database with Entity Framework 6.1.3.</p>
  
  <p>I have this:</p>
  
  <pre><code>codes = codesRepo.SearchFor(predicate)
        .Select(c =&gt; new Tuple&lt;string, byte&gt;(c.Id, c.Flag))
        .ToList();
  </code></pre>
  
  <p>And when I run it, I get this message:</p>
  
  <blockquote>
    <p>Only parameterless constructors and initializers are supported in LINQ
    to Entities.</p>
  </blockquote>
  
  <p>I don't know how I have to create the Tuple because all the examples that I have found are mostly like this one.</p>
  
  <p>I have tried this:</p>
  
  <pre><code>codes = codesRepo.SearchFor(predicate)
        .Select(c =&gt; Tuple.Create(c.Id, c.Flag))
        .ToList();
  </code></pre>
  
  <p>And get this error:</p>
  
  <blockquote>
    <p>LINQ to Entities does not recognize the method
    'System.Tuple`2[System.String,System.Byte]
    Create[String,Byte](System.String, Byte)' method, and this method
    cannot be translated into a store expression.</p>
  </blockquote>
  
  <p>Where is the problem?</p>