title: How do I map multiple tables to single entity, with an outer join, in Entity Framework?
body: <p>I have two tables:</p>
  
  <p><strong>Invoice</strong> (ID, InternalPrice, ExternalPrice)<br>
  <strong>InvoiceSummary</strong> (InvoiceID, Variance )</p>
  
  <p>In this application we have a process that goes through the Invoice table, creating object representations in Entity Framework. The application must then compute the difference between the (InternalPrice – ExternalPrice) and store it in the Variance column. </p>
  
  <p>To allow entity framework to perform this efficiently on large numbers of rows (~ 5 million) I have separated the compute result into an individual table. This allows me to use object representations to compute the variance (plus other business logic), and then use 'SQL bulk insert' to insert the data into my database quickly (much faster than a normal Entity update). </p>
  
  <p>I’d like to merge the Invoice &amp; InvoiceSummary tables into a single entity object, while keeping separate tables for the BCP connivance as described above. However there may not always be a matching row in InvoiceSummary. </p>
  
  <p>It looks like Entity Framework requires a 1 to 1 mapping between the two tables to implement a merged entity. <strong>Does anyone know how I can get Entity Framework to represent this with a 0 to 1 mapping?</strong> </p>
  
  <p>If I don’t find an entity framework solution I could use a view to ‘hide’ the underlying table structure. I'm using SQL server, which supports updatable views, so this should be transparent to EF? Alternate structures solutions are welcome as well.</p>