title: EF Code First, map two navigation properties to the same object type
body: <p>If I have a <code>User</code> class  that has these properties:</p>
  
  <pre><code>    public Guid UserPreferenceId { get; set; }
      public virtual DefaultUserPreference UserPreference { get; set; }
  
      public Guid SecondaryUserPreferenceId { get; set; }
      public virtual DefaultUserPreference SecondaryUserPreference { get; set; }
  </code></pre>
  
  <p>How can I get this to make via fluent API? When I try to run this it says:</p>
  
  <blockquote>
    <p>Introducing FOREIGN KEY constraint on table 'Users' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
    Could not create constraint. See previous errors.</p>
  </blockquote>
  
  <p>I've seen a few of these questions but they always involve one single navigation property and one collection. Also the relationship is unidirectional, but it could be bidirectional if it had to be, not sure if that matters.</p>