title: ASP.NET MVC - not getting data from other tables
body: <p>These are my classes:</p>
  
  <pre><code>public class HotelRoomRatingView
      {
          public int HotelID { get; set; }
          public roomKinds RoomKinds { get; set; }
          public HotelReview HotelReview { get; set; }
  
          public HotelRoomRatingView()
          {
          }
          public HotelRoomRatingView(int hotelId, roomKinds rooms, HotelReview review)
          {
              this.HotelID = hotelId;
              this.RoomKinds = rooms;
              this.HotelReview = review;
          }
      }
  
  public class HotelReview
  {
      public int HotelReviewID { get; set; }
  
      public double Rating { get; set; }
  
      public List&lt;Review&gt; Reviews { get; set; }
  
      public HotelReview()
      {
          this.Reviews = new List&lt;Review&gt;();
      }
  }
  
  public partial class roomKinds : object, System.ComponentModel.INotifyPropertyChanged
  {
      [Key]
      public int roomKindsId { get; set; }
  
      private ObservableCollection&lt;objectKind&gt; objectKindField;
  
      public roomKinds()
      {
  
      }
      public roomKinds(Class.roomKinds origin)
      {
          this.objectKindField = origin.objectKind;
      }
  
      [System.Xml.Serialization.XmlElementAttribute(Order = 0)]
      public ObservableCollection&lt;objectKind&gt; objectKind
      {
          get
          {
              return this.objectKindField;
          }
          set
          {
              this.objectKindField = value;
              this.RaisePropertyChanged("objectKind");
          }
      }
  
      public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
  
      protected void RaisePropertyChanged(string propertyName)
      {
          System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
          if ((propertyChanged != null))
          {
              propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
          }
      }
  }
  public partial class Hotel : object, System.ComponentModel.INotifyPropertyChanged
      {
          [Key]
          public int HotelId { get; set; }
          private int hotIdField;
          // many others properties
          [System.Xml.Serialization.XmlElementAttribute(Order = 105)]
          public HotelReview hotelReview
          {
              get;
              set;
          }
  
          [System.Xml.Serialization.XmlElementAttribute(Order = 104)]
          public roomKinds rooms
          {
              get;
              set;
          }
  
          [System.Xml.Serialization.XmlElementAttribute(Order = 0)]
          public int hotId
          {
              get
              {
                  return this.hotIdField;
              }
              set
              {
                  this.hotIdField = value;
                  this.RaisePropertyChanged("hotId");
              }
          }
      }
  </code></pre>
  
  <p>Get method in my repository looks like this:</p>
  
  <pre><code>public Models.Hotel Get(int id)
          {
              return db.hotels.SingleOrDefault(h =&gt; h.hotId == id);
          }
  </code></pre>
  
  <p><code>HotelId</code> and <code>hotId</code> are okay I need it this way. So I am getting Hotel from database by LINQ and I get Hotel but I am not getting data from other tables. I am not getting <code>HotelReview</code> and <code>RoomKinds</code>. I got null in these properties but in database they are and they are connected with <code>Hotel</code> by <code>ID</code>.
  Thanks for help</p>