title: One-to-Many and One-to-One (from Customer to Address)
body: <p>I try to create two relationships between two entities in EF Core.</p>
  <ul>
  <li>One-to-One: <em>Customer.DefaultAddress -&gt; Address</em></li>
  <li>One-to-Many: <em>Customer.Addresses -&gt; Address</em></li>
  </ul>
  <p>You can see it in my code:</p>
  <pre class="lang-cs prettyprint-override"><code>public class Customer
  {
      public Guid CustomerId { get; set; }
  
      // can be null
      public ICollection&lt;Address&gt; Addresses { get; set; }
      
      // can be null
      public Address DefaultAddress { get; set; }
      
      // ...
  }
  
  public class Address
  {
      public Guid AddressId { get; set; }
      
      public Customer Customer { get; set; }
      public Guid CustomerId { get; set; }
  
      // ...
  }
  
  public class Context : DbContext
  {
      public DbSet&lt;Address&gt; Addresses { get; set; }
      public DbSet&lt;Customer&gt; Customers { get; set; }
      
      protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
      { 
          optionsBuilder.UseSqlServer(@&quot;Server=.;Database=AllAndDefault;Trusted_Connection=True;&quot;);
      }
  }
  </code></pre>
  <p>When I try to create a migration, it throws an exception:</p>
  <blockquote>
  <p>Unable to determine the relationship represented by navigation property 'Address.Customer' of type 'Customer'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'Entity
  TypeBuilder.Ignore' in 'OnModelCreating'.</p>
  </blockquote>
  <p>I tried to configure the relationship manually in the OnModelCreating method, but it still does not work with other exceptions.</p>