title: What do I need to add into OnModelCreating(DbModelBuilder modelBuilder) function to define relations between Person and Role?
body: <p>I'm using EntityFramework version 5.0 in WinForms project, .net 4.5.</p>
  
  <p>I have created 2 for me important Entities</p>
  
  <pre class="lang-cs prettyprint-override"><code>    public class Role
      {
          [Key]
          [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
          public int Id { get; set; }
          public string Name { get; set; }
          public bool StockPermission { get; set; }
          public bool ItemPermission { get; set; }
          public bool OrderPermission { get; set; }
          public bool PersonPermission { get; set; }
          public bool StatisticPermission { get; set; }
      }
  
      public class Person
      {
          [Key]
          [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
          public int Id { get; set; }
          public String Name { get; set; }
          public String Nickname { get; set; }
          public String Contact { get; set; }
          public System.DateTime Created { get; set; }
          public String Pincode { get; set; }
  
          public virtual ICollection&lt;Role&gt; Role { get; set; }
          public virtual Person Creator { get; set; }
      }
  </code></pre>
  
  <p>and dbContext class:</p>
  
  <pre class="lang-cs prettyprint-override"><code>    public class SusibarDbContext : DbContext
      {
          public DbSet&lt;Entity.Role&gt; Roles { get; set; }
          public DbSet&lt;Entity.Person&gt; Persons { get; set; }
  
          protected override void OnModelCreating(DbModelBuilder modelBuilder)
          {
              //base.OnModelCreating(modelBuilder);
          }
      }
  </code></pre>
  
  <p>please, can you help me what I need to add into <code>OnModelCreating(DbModelBuilder modelBuilder)</code> function to define relations between Person and Role?</p>
  
  <p>Person can have many Role(s) (but can't be null), different Persons can have same Role(s).</p>
  
  <p>Person can have one "creator" Person (can be null), different Persons can have same "creator"</p>
  
  <p>If you could be so kind, just advise me solution :-(</p>