title: The navigation property 'SenderId' is not a declared property on type 'Conversation'
body: <p>When I try to do Update-Database, I get this error: </p>
  
  <blockquote>
    <p>The navigation property 'SenderId' is not a declared property on type 'Conversation'. Verify that it has not been explicitly excluded from the model and that it is a valid navigation property.</p>
  </blockquote>
  
  <p><strong>Edit</strong></p>
  
  <p>I believe problem is in mapping relations between Conversation and User, because Conversation and User are connected with two one to many relationships i.e. Conversation has two foreign keys pointing to User</p>
  
  <p>Here is how User and Conversation are connected:</p>
  
  <p>User:</p>
  
  <pre><code>public class User
  {
      [Key]
      [HiddenInput(DisplayValue = false)]
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public Guid UserId { get; set; }
  
      public virtual ICollection&lt;Conversation&gt; ConversationSenders { get; set; }
      public virtual ICollection&lt;Conversation&gt; ConversationRecievers { get; set; }
  </code></pre>
  
  <p>Conversation:</p>
  
  <pre><code>public class Conversation
  {
      [Key]
      [HiddenInput(DisplayValue = false)]
      public Guid ConversationId { get; set; }
  
      [ForeignKey("SenderId")]
      public Guid SenderId { get; set; }
  
      [ForeignKey("RecieverId")]
      public Guid RecieverId { get; set; }
  
      [InverseProperty("ConversationSenders")]
      public virtual User Sender { get; set; }
  
      [InverseProperty("ConversationRecievers")]
      public virtual User Reciever { get; set; }
  
  }
  </code></pre>
  
  <p>Here is whole code: </p>
  
  <p>User:</p>
  
  <pre><code>public class User
  {
      [Key]
      [HiddenInput(DisplayValue = false)]
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public Guid UserId { get; set; }
  
  
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public Guid CollegeId { get; set; }
  
      public int RoleId { get; set; }
  
      [Required]
      [DataType(DataType.EmailAddress)]
      public string Email { get; set; }
  
      [Required]
      [DataType(DataType.Password)]
      public string Password { get; set; }
  
      [Required]
      public string Name { get; set; }
  
      [Required]
      public string Surname { get; set; }
  
      public string Gender { get; set; }
  
      //role
  
      public DateTime? DateOfBirth { get; set; }
  
  
      public string ImageURL { get; set; }
  
      [ForeignKey("CollegeId")]
      public virtual College College { get; set; }
  
      [ForeignKey("RoleId")]
      public virtual UserRole UserRole { get; set; }
  
      public virtual ICollection&lt;Advert&gt; Adverts { get; set; }
      public virtual ICollection&lt;Competition&gt; Competitions { get; set; }
      public virtual ICollection&lt;Message&gt; Messages { get; set; }
      public virtual ICollection&lt;Conversation&gt; ConversationSenders { get; set; }
      public virtual ICollection&lt;Conversation&gt; ConversationRecievers { get; set; }
      public virtual ICollection&lt;UserOS&gt; UserOses { get; set; }
  </code></pre>
  
  <p>Conversation:</p>
  
  <pre><code>public class Conversation
  {
      [Key]
      [HiddenInput(DisplayValue = false)]
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public Guid ConversationId { get; set; }
  
      [ForeignKey("SenderId")]
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public Guid SenderId { get; set; }
  
      [ForeignKey("RecieverId")]
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public Guid RecieverId { get; set; }
  
      [InverseProperty("ConversationSenders")]
      public virtual User Sender { get; set; }
  
      [InverseProperty("ConversationRecievers")]
      public virtual User Reciever { get; set; }
  
      public virtual ICollection&lt;Message&gt; Messages { get; set; }
  }
  </code></pre>
  
  <p>Message</p>
  
  <pre><code> public class Message
  {
      [Key]
      [HiddenInput(DisplayValue = false)]
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public Guid MessageId { get; set; }
  
      [HiddenInput(DisplayValue = false)]
      public Guid UserId { get; set; }
  
      [HiddenInput(DisplayValue = false)]
      public Guid ConversationId { get; set; }
  
      public string Text { get; set; }
  
      public bool? IsSeen { get; set; }
  
  
      [ForeignKey("UserId")]
      public virtual User ConversationSender { get; set; }
  
      [ForeignKey("ConversationId")]
      public virtual Conversation Conversation { get; set; }
  }
  </code></pre>