title: Composite primary key with two foreign keys from two different tables mvc
body: <p>I am fairly new to ASP.NET MVC, I have tried to find a solution for this but I am unable to find a similar example, I have read that this is because of my relationship being null when it has to be *. I want my ProposalFB table to have a composite primary key of a lecturer email(lecEmail) and a student email(studEmail) both coming from different tables(Lecturer and Student), at first, I thought I could fix it if there was data in the lecturer and student table unfortunately that did not work. Whenever I try to scaffold I get 
  <a href="https://i.stack.imgur.com/z3m7t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z3m7t.png" alt="enter image description here"></a></p>
  
  <p>My models look like this:
  Student.cs</p>
  
  <pre><code>public class Student
  {
      [Key]
      public string studEmail { get; set; }
      public string projectType { get; set; }
      public string projectTitle { get; set; }
      [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
      public Nullable&lt;System.DateTime&gt; year { get; set; }
      public virtual ProposalFB ProposalFB { get; set; }
  }
  </code></pre>
  
  <p>Lecturer.cs</p>
  
  <pre><code>public class Lecturer
  {
      [Key]
      public string lecEmail { get; set; }
      public virtual ProposalFB ProposalFB { get; set; }
  }
  </code></pre>
  
  <p>ProposalFB.cs</p>
  
  <pre><code>public class ProposalFB
  {
      [Key, ForeignKey("Student"), Column(Order = 0)]
      public string studEmail { get; set; }
      [Key, ForeignKey("Lecturer"), Column(Order = 1)]
      public string lecEmail { get; set; }
      public string feedback1 { get; set; }
      public string feedback2 { get; set; }
      public string feedback3 { get; set; }
      public string feedback4 { get; set; }
      public string feedback5 { get; set; }
      public float proposalMark { get; set; }
      public Nullable&lt;System.DateTime&gt; createdOn { get; set; }
      public Nullable&lt;System.DateTime&gt; modified { get; set; }
      public bool status { get; set; }
      public virtual Student Student { get; set; }
      public virtual Lecturer Lecturer { get; set; }
  }
  </code></pre>
  
  <p>Really appreciate some guidance to how to correct this</p>