title: Unable to determine the principal end of an association between the types - Entity Framework error, class relationship between the same class
body: <p>Have the class below, and try to look for records in the database returns error. 
  Using C #, MVC 4, Entity Framework 4 and SQL Server 2012 database.</p>
  
  <h3>Error</h3>
  
  <pre><code>Unable to determine the principal end of an association between the types 'FlexApp.Models.Model.Usuario' and 'FlexApp.Models.Model.Usuario'. 
  
  The principal end of this association must be explicitly configured using either the relationship fluent API or data annotations.
  </code></pre>
  
  <h3>Class</h3>
  
  <pre><code>public class Usuario
  {
      [Key]
      public int UsuarioID { get; set; }
      public string Nome { get; set; }
      public int UsuCad { get; set; }        
      public int UsuAlt { get; set; }
  
      [ForeignKey("UsuCad")]
      public virtual Usuario UsuarioCad { get; set; }
      [ForeignKey("UsuAlt")]
      public virtual Usuario UsuarioAlt { get; set; }
  }
  </code></pre>
  
  <h3>DataBase FK</h3>
  
  <pre><code>alter table USUARIO add constraint USUARIO_fk01 foreign KEY(UsuCad) REFERENCES USUARIO(UsuarioID);
  alter table USUARIO add constraint USUARIO_fk02 foreign KEY(UsuAlt) REFERENCES USUARIO(UsuarioID);
  </code></pre>