title: Configure a principal key or a set of compatible foreign key properties for this relationship error with EF core
body: <p>I am not sure why I am getting this error:
  System.InvalidOperationException: 'The relationship from 'Insured' to 'Quote.Insureds' with foreign key properties {'InsuredID' : string} cannot target the primary key {'InsuredID' : string, 'ProducerID' : string} because it is not compatible. Configure a principal key or a set of compatible foreign key properties for this relationship.'</p>
  <p>I am trying to configure two keys in the Quote model, one for my Insured model and one for my Producer. I attempted to only have one key before and just use foreign keys but that didnt work.</p>
  <pre><code> public class Producer 
      {
          [Key]
          public string ProducerID { get; set;  }
          public string Name { get; set; }
          public string Phone { get; set; }
  </code></pre>
  <pre><code>public class Insured
      {
          [Key]
          public string InsuredID { get; set; }
          public string NamedInsured { get; set; }
          public string Address1 {get; set;} 
  </code></pre>
  <pre><code>public class Quote
      {
          public string InsuredID { get; set; }
          public string ProducerID { get; set; }
          [ForeignKey(&quot;ProducerID&quot;)]
          public IList&lt;Producer&gt; Producers { get; set; }   
          [ForeignKey(&quot;InsuredID&quot;)]
          public IList&lt;Insured&gt; Insureds { get; set; }
  </code></pre>
  <p>In my DB context:</p>
  <pre><code> protected override void OnModelCreating(ModelBuilder builder)
          {
              builder.Entity&lt;Quote&gt;().HasKey(q =&gt; new { q.InsuredID , q.ProducerID});
  </code></pre>