title: Load foreign key value with linq to entities
body: <p>I have a table Admins, which creates a relationship between Users and Locations:</p>
  
  <pre><code>ID - numeric (PK)
  UserId - uniqueidentifier (FK to UserId in aspnet_Users table)
  LocationId - numeric
  </code></pre>
  
  <p>Now I want to execute command:</p>
  
  <pre><code>IQueryable&lt;decimal&gt; location_ids = (from m in _db.Admins
                                      where m.UserId.Equals( new Guid("c5d3dc0e-81e6-4d6b-a9c3-faa802e10b7d")) &amp;&amp; m.LocationId.Equals(conf.umisteni.Budova.ID)
                                      select m.LocationId);
  </code></pre>
  
  <p>But for some reason (I guess the UsersId is FK) m.UserId can't be resolved. So I tried to use</p>
  
  <pre><code>m.aspnet_UsersReference.Value.UserId
  </code></pre>
  
  <p>But then the decision statement</p>
  
  <pre><code>if (!location_ids.Any())
  </code></pre>
  
  <p>fails with exception</p>
  
  <pre><code>System.NotSupportedException: The specified type member 'aspnet_UsersReference' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.
  </code></pre>
  
  <p>What should I do in order to get the enumerable list of LocationIds?</p>
  
  <p>Thanks in advance.</p>