title: EF core one-to-many relationships HasOne().WithMany() vs HasMany().WithOne()
body: <p>Let's say I have the following 2 models:</p>
  
  <pre><code>public class Blog
  {
      public int BlogId { get; set; }
      public string Url { get; set; }
  
      public List&lt;Post&gt; Posts { get; set; }
  }
  
  public class Post
  {
      public int PostId { get; set; }
      public string Title { get; set; }
      public string Content { get; set; }
  
      public Blog Blog { get; set; }
  }
  </code></pre>
  
  <p>Now if I want to configure the models relationships in DbContext is there any difference between:</p>
  
  <pre><code>modelBuilder.Entity&lt;Post&gt;()
              .HasOne(p =&gt; p.Blog)
              .WithMany(b =&gt; b.Posts);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>modelBuilder.Entity&lt;Blog&gt;()
              .HasMany(b =&gt; b.Posts)
              .WithOne(p =&gt; p.blog);
  </code></pre>
  
  <p>and if there is a diffrence, what is it? should I write both or just one of them?</p>
  
  <p><strong>As a side note:</strong> Do I have to define foreign keys? Based on my knowledge about databases, you can't create relationships without foreign keys but EF doesn't require you to have foreign key fields. So how does EF handles relationships without knowing foreign keys? Does it cause performance drops or bugs?</p>