title: All containing foreign keys must be removed or redefined before the property can be removed - EF Core
body: <p>I am getting the above error when trying to add migration after add a foreign key using Entity Framework core.
  I am adding FK in</p>
  <pre><code>public class ApplicantDetail
      {
          [Key]
          public int Id { get; set; }
          [ForeignKey(&quot;GrantProgramFK&quot;)]
          public GrantProgram GrantProgramId { get; set; }
   --------
     }
  </code></pre>
  <p>This FK ties to class</p>
  <pre><code>public class GrantProgram
      {
          [Key]
          public int Id { get; set; }
     -----
      }
  </code></pre>
  <p>Any help is appreciated. I tried to remove the entity and run migration again, but failed.</p>
  <p>Full error:</p>
  <blockquote>
  <p>The property 'GrantProgramId' cannot be removed from entity type 'EFDataAccessLibrary.Models.ApplicantDetail' because it is being used in the foreign key {'GrantProgramId'} on 'EFDataAccessLibrary.Models.ApplicantDetail'. All containing foreign keys must be removed or redefined before the property can be removed</p>
  </blockquote>
  <p>I found a page,
  <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.diagnostics.corestrings.propertyinuseforeignkey?view=efcore-3.1" rel="noreferrer">click here</a>, but what does that mean? how to resolve it.</p>