title: WCF RIA Services, Joining Tables in Domain Service
body: <p>I'm making a Silverlight WCF RIA Services application. Although, I'm stuck attempting different ways to use multiple Tables in the database. 
  Currently, I'm trying to join tables in the Domain Service Class and return it to the service agent. I started this project from a template located at:
  <a href="http://simplemvvmtoolkit.codeplex.com/wikipage?title=WCF%20RIA%20Services" rel="nofollow">http://simplemvvmtoolkit.codeplex.com/wikipage?title=WCF%20RIA%20Services</a></p>
  
  <p>I'm trying to join tables like: </p>
  
  <pre><code>    public IQueryable&lt;Invoice&gt; GetInvoices()
      {
          return (from i in this.ObjectContext.Invoices 
                  join o in this.ObjectContext.otherTable equals condition 
                  join s in this.ObjectContext.otherTable equals condition 
                  select i); 
      }
  </code></pre>
  
  <p>This joins the tables correctly based on the given conditions. But I actually need to Project Fields from both the i.Invoices Tables &amp; s.otherTable.
  Any suggestions to make this projection work in the DomainServiceClass.cs ?</p>
  
  <p>SAMPLE CODE FROM USER "Chris" Suggestion: </p>
  
  <pre><code>    public class Invoice_PM
      {
      [Key]
      public int InvoiceId { get; set; }
  
      public string PaymentNum { get; set; }
  
      public DateTime? PaymentExpDate { get; set; }
  
      public DateTime? InvoiceDateTime { get; set; }
  
      [Include, Association("name", "InvoiceID", "InvoiceDateTime")]
      public IEnumerable&lt;InvoiceSoldToShipTo_PM&gt; SoldToShipTo { get; set; }
  }
  </code></pre>