title: Return anonymous type results?
body: <p>Using the simple example below, what is the best way to return results from multiple tables using Linq to SQL?</p>
  
  <p>Say I have two tables:</p>
  
  <pre><code>Dogs:   Name, Age, BreedId
  Breeds: BreedId, BreedName
  </code></pre>
  
  <p>I want to return all dogs with their <code>BreedName</code>.  I should get all dogs using something like this with no problems:</p>
  
  <pre><code>public IQueryable&lt;Dog&gt; GetDogs()
  {
      var db = new DogDataContext(ConnectString);
      var result = from d in db.Dogs
                   join b in db.Breeds on d.BreedId equals b.BreedId
                   select d;
      return result;
  }
  </code></pre>
  
  <p>But if I want dogs with breeds and try this I have problems:</p>
  
  <pre><code>public IQueryable&lt;Dog&gt; GetDogsWithBreedNames()
  {
      var db = new DogDataContext(ConnectString);
      var result = from d in db.Dogs
                   join b in db.Breeds on d.BreedId equals b.BreedId
                   select new
                          {
                              Name = d.Name,
                              BreedName = b.BreedName
                          };
      return result;
  }
  </code></pre>
  
  <p>Now I realize that the compiler won't let me return a set of anonymous types since it's expecting Dogs, but is there a way to return this without having to create a custom type?  Or do I have to create my own class for <code>DogsWithBreedNames</code> and specify that type in the select?  Or is there another easier way?</p>