title: Mvc 4 CodeFirst ModelBuilder ForeignKey
body: <p>I have trying to write this section in MVC 4 for a bit now and I just cant get the syntax right. I have a user class in my entities and every user has messages. On my messages the will be linked to the user via either sender or receiver. So this will have back and forth access methods. That way i can pull messages and either access through code first who the sender and receiver is, or access the the message they sent or received through the user.</p>
  
  <p>I removed the modelBuilder info fromt he script and im back to fresh, If you need me to post any other info, plz let me know. </p>
  
  <pre><code>public class User
      {
              [Key]
              public Guid UserId { get; set; }
  
              public String Username { get; set; }
              public String Email { get; set; }
              public String Password { get; set; }
              public DateTime? BirthDate { get; set; }
              public String SecurityAnswer { get; set; }
              public String SecurityQuestion { get; set; }
  
  
  
              public ICollection&lt;Message&gt; PrivateMessages { get; set; }
              public ICollection&lt;Message&gt; SentMessages { get; set; }
  
      }
  
  
  
  public class Message
      {
          [Key]
          public long Id { get; set; }
  
          public User Reciever { get; set; }
          public User Sender { get; set; }
  
          public string Title { get; set; }
          public string Message { get; set; }
          public DateTime PostDate { get; set; }
      }
  </code></pre>