title: Entity Framework equivalent of multiple joins?
body: <p>I am not actually sure if this is a case for inheritance or something else entirely.  I have a set of 3 tables that exist in my database. GeoSales, CountryRef &amp; RegionRef. <a href="https://i.stack.imgur.com/Dz3YT.png" rel="nofollow noreferrer">EF Designer</a> The GeoSales Table has a CountryID which is a foreign key to the CountryRef Table.  The Countryref Table has a regionID , which is a foreign key to the Regionref table. Every GeoSale has a CountryID, and every Countryref has a RegionID. There is also a Location table that has a foreign key of locationID to the Geosales Table </p>
  
  <p>In this case, I would like to make it possible to display the RegionName field in my  application.  I am primarily a SQL developer, so I am not very strong in c# and the vast majority of the tutorials I see are for a code first approach, and have a bunch of C# code that I don't really understand.  Within Sql, I would just use 2 joins like this: </p>
  
  <pre><code>SELECT * FROM GeoSales G 
  JOIN CountryRef C ON C.CountryId = G.CountryID 
  JOIN RegionRef R ON R.RegionID = C.RegionID
  JOIN Location L ON L.LocationdiD = G.LocationID
  </code></pre>
  
  <p>Within my MVC/EF Project,  how Would I create this relationship in such a way that Views can include the Region information with the GeoSales Record? </p>
  
  <p>One of the things that I have considered was adding an FK to the regionref table to the GeoSales Table in addition to the countryref table, but I am not sure if that would result in the behavior I am looking for.  There can be 1 region &amp; 1 country on a Geosale record, and there can be many countries in a region, and many geosales in a country. 
  This is my class for the GeoSales </p>
  
  <pre><code>public partial class GeoSale
  {
      public int ID { get; set; }
      public int LocationID { get; set; }
      public Nullable&lt;int&gt; CountryId { get; set; }
      public Nullable&lt;decimal&gt; Amount { get; set; }
      public Nullable&lt;int&gt; Year { get; set; }
  
      public virtual CountryRef CountryRef { get; set; }
      public virtual Location Location { get; set; }
  
  }
  }
  </code></pre>
  
  <p>And This is my class for CountryRef</p>
  
  <pre><code> public partial class CountryRef
      {
          [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
          public CountryRef()
          {
              this.GeoSales = new HashSet&lt;GeoSale&gt;();
          }
  
          public int CountryID { get; set; }
          public string CountryName { get; set; }
          public Nullable&lt;int&gt; RegionID { get; set; }
  
          public virtual RegionRef RegionRef { get; set; }
          [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
          public virtual ICollection&lt;GeoSale&gt; GeoSales { get; set; }
      }
  </code></pre>