title: How to make Entity Framework Core create a foreign key constraint that is not enforced
body: <p>I'm using code-first with EF Core 3.1.2</p>
  <p>I have established the following two-way one-to-one relationship in the OnModelCreating method of my DbContext.</p>
  <pre><code>modelBuilder.Entity&lt;Inspection&gt;()
      .HasOne&lt;Defect&gt;(i =&gt; i.SpecialDefect)
      .WithOne(d =&gt; d.SpecialInspection);
  </code></pre>
  <p>This creates foreign key constraints in the database.
  I would like these constrains to be non-enforced.
  i.e. I would like the &quot;Enforce Foreign Key Constraint&quot; option to be set to &quot;No&quot;. By default, this is set to yes.</p>
  <p><a href="https://i.stack.imgur.com/mIzIs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mIzIs.png" alt="enter image description here" /></a></p>
  <p>Is this possible? If so, how might I do this?</p>