title: User in Entity type MVC5 EF6
body: <p>I have created a class in MVC5, where I want a primary owner of the content and then I want to have some editors for the content:</p>
  
  <pre><code>public class Content
  {
      public int ID { get; set; }
      public IdentityUser Owner { get; set; }
      public ICollection&lt;IdentityUser&gt; Editors { get; set; }
      public string Title{ get; set; }
      public string Body { get; set; }
  }
  </code></pre>
  
  <p>In the database context I have the following code:</p>
  
  <pre><code>protected override void OnModelCreating(DbModelBuilder modelBuilder)
  {
      base.OnModelCreating(modelBuilder);
  
      modelBuilder.Entity&lt;Content&gt;()
          .HasOptional(c =&gt; c.Editors)
          .WithRequired()
          .WillCascadeOnDelete();
  
      modelBuilder.Entity&lt;Content&gt;()
          .HasRequired(c =&gt; c.Owner)
          .WithOptional()
          .WillCascadeOnDelete();
  }
  </code></pre>
  
  <p>I would expect Microsoft to have implemented the <code>IdentityUser</code> object in such a way, that it can be used in other entity types, so I am probably doing something wrong, because when I try to make a controller for the Content entity type, I get the following error:</p>
  
  <pre><code>EntityType 'IdentityUserLogin' has no key defined
  EntityType 'IdentityUserRole' has no key defined
  EntityType: EntitySet 'IdentityUserLogins' is based on type 'IdentityUserLogin' that has no key defined
  EntityType: EntitySet 'IdentityUserRoles' is based on type 'IdentityUserRole' that has no key defined
  </code></pre>
  
  <p>I have also tried to add the following code to the <code>ApplicationDbContext</code> as described in this question <a href="https://stackoverflow.com/questions/19474662/map-tables-using-fluent-api-in-asp-net-mvc5-ef6">Map tables using fluent api in asp.net MVC5 EF6?</a>:</p>
  
  <pre><code>protected override void OnModelCreating(DbModelBuilder modelBuilder)
  {
      base.OnModelCreating(modelBuilder);
      modelBuilder.Entity&lt;IdentityUserLogin&gt;().HasKey&lt;string&gt;(l =&gt; l.UserId);
      modelBuilder.Entity&lt;IdentityRole&gt;().HasKey&lt;string&gt;(r =&gt; r.Id);
      modelBuilder.Entity&lt;IdentityUserRole&gt;().HasKey(r =&gt; new { r.RoleId, r.UserId });
  }
  </code></pre>
  
  <p>I must be doing something wrong. Please tell me how I can handle users in my Content EntityType.</p>