title: Making an Entity Framework Model span multiple databases
body: <p>Is it valid to do something such as </p>
  
  <p><code>CREATE SYNONYM [dbo].[MyTable] FOR [AnotherDatabase].dbo.[MyTable]</code></p>
  
  <p>and then modify Entity Framework's edmx file to read this object like it would any other table? </p>
  
  <p>I did a quick sample test and it seems to work fine for selecting and updating, but I wanted to know if there was any reason why I shouldn't be doing this</p>
  
  <p>I am getting the table definition by creating an edmx file pointing to the 2nd database, building out the entities there, then copy/pasting the definition into the 1st database's edmx file.</p>
  
  <p><strong>UPDATE</strong> </p>
  
  <p>If anyone is interested, I wrote up what I did to make an edmx file span mulitple databases <a href="http://rachel53461.wordpress.com/2011/05/22/tricking-ef-to-span-multiple-databases/" rel="noreferrer">here</a>. It includes scripts for generating synonyms and merging edmx files.</p>