title: Entity Framework creates non-existing column in query
body: <p>I face the problem that EF creates a column in the query that does not exist in the Oracle database table.</p>
  <p>The simplified model which is created by EF looks like this (I use DB first approach):</p>
  <pre><code>public partial class USER
  {
      public int ID { get; set; }    
      public string NAME { get; set; }    
      public int PROCESS_ID { get; set; }
  
      public virtual PROCESS PROCESS { get; set; }
  }
  
  public partial class PROCESS
  {
      public PROCESS()
      {
          this.USER = new HashSet&lt;User&gt;();
      }
  
      public int ID { get; set; }
      
      public virtual ICollection&lt;USER&gt; USER { get; set; }
  }
  </code></pre>
  <p>I set up the foreign key constraint in the oracle sql developer.</p>
  <p>When I try to get the Users for a selected Process like this:</p>
  <pre><code>var users = context.Users.Where(u =&gt; u.PROCESS_ID == 0);
  </code></pre>
  <p>It produces following error:</p>
  <pre><code>ORA-00904: &quot;Extent1&quot;.&quot;R1&quot;: invalid ID
  </code></pre>
  <p>So i took a look on the produced SQL:</p>
  <pre><code>SELECT 
  &quot;Extent1&quot;.ID,
  &quot;Extent1&quot;.NAME,
  &quot;Extent1&quot;.R1,
  FROM DB.USER &quot;Extent1&quot;
  WHERE &quot;Extent1&quot;.R1 = :p__linq__0
  </code></pre>
  <p>Of course this produces an error because R1 isn't a column in the table. But I can't figure out where it comes from. It seems like EF can't map the foreign key properly thats why it's also missing in the generated SQL query?</p>
  <p>Maybe someone has a tip for me :)</p>