title: Entity framework relationship
body: <p>I have one <code>Student</code> class and one <code>Standard</code> class. For example:</p>
  
  <pre><code>public class Student
  {
      public Student() { }
  
      public int StudentId { get; set; }
  
      [Required]
      public string StudentName { get; set; }
  
      public int StdandardId { get; set; }
  
      public virtual Standard Standard { get; set; }
  }
  
   public class Standard
    {
      public Standard()
      {
          StudentsList = new List&lt;Student&gt;();
      }
      public int StandardId { get; set; }
      public string StandardName { get; set; }
      public string Description { get; set; }
  
      public virtual ICollection&lt;Student&gt; Students { get; set; }
    }
  </code></pre>
  
  <p>Now I am storing record like this:</p>
  
  <p>I have some standard entries already in the database. Suppose I have one standard entry which has id 4. Now I am storing student corresponding to that</p>
  
  <pre><code>Student s=new student();
  s.StudentName="Priyesh";
  s.StandardId=4;
  context.Student.add(s);
  context.savechanges();
  </code></pre>
  
  <p>now I want to return student object back to UI with standard object set but I am getting standard object as null(<code>s.Standard</code> is null). Please suggest a solution.</p>