title: Entity Framework validation error when nullable FK is null
body: <p>Info: .Net Framework WPF application, Entity Framework 6</p>
  <p>When I try to add an entity to my database table with its nullable foreign key set to null, I get the following validation error from Entity Framework:</p>
  <blockquote>
  <p>Exception thrown: 'System.Data.Entity.Validation.DbEntityValidationException' in EntityFramework.dll<br />
  Entity of type &quot;Item&quot; in state &quot;Added&quot; has the following validation errors:<br />
  Property: &quot;SomeForeignKeyId&quot;,<br />
  Error: &quot;Field &quot;SomeForeignKeyID&quot; is required.</p>
  </blockquote>
  <p>I have the foreign key declared without any attributes such as <code>[Required]</code> as was the case <a href="https://stackoverflow.com/questions/13067288/entity-framework-required-foreign-key-validation-error-on-db-savechanges">here</a>, so that answer doesn't apply to me. Its just a simple FK:</p>
  <pre><code> public int? SomeForeignKeyId { get; set; }
  </code></pre>
  <p>Now a temporary fix for me was to just disable EF validation</p>
  <pre><code> Configuration.ValidateOnSaveEnabled = false;
  </code></pre>
  <p>which obviously isn't the best solution. So what is the issue here?</p>