title: How to return anonymous type from c# method that uses LINQ to SQL
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/534690/linq-to-sql-return-anonymous-type">LINQ to SQL: Return anonymous type?</a>  </p>
  </blockquote>
  
  <p>I have a standard LINQ to SQL query, which returns the data as an anonymous type (containing about 6 columns of data of various datatypes).</p>
  
  <p>I would like to make this returned object available to other parts of the program, either by returning it to the method-caller, or by assigning it to a property of the object containing the method.</p>
  
  <p>How can I do this given that it is an anonymous type ("var")?</p>
  
  <p>EDIT - Here is the code:</p>
  
  <pre><code>    using (ormDataContext context = new ormDataContext(connStr))
      {
          var electionInfo = from t1 in context.elections
                     join t2 in context.election_status
                     on t1.statusID equals t2.statusID
                     select new { t1, t2 };
      }
  </code></pre>