title: Entity Framework 7 trouble creating migration because navigation property with the same name exists
body: <p>I'm trying to create my first migration using Entity Framework 7 with code first development and I'm getting the following error:</p>
  
  <blockquote>
    <p>The property 'Email' cannot be added to the entity type 'UserDTO'
    because a navigation property with the same name already exists on
    entity type 'UserDTO'.</p>
  </blockquote>
  
  <p>My environment is:
  1) Visual Studio 2015
  2) Entity Framework v7.0.0-rc1-final
  3) Code first development
  4) Using the fluent API, not data annotations</p>
  
  <p>I can't figure out what the root cause of the issue is but I've got a few ideas. My RoleDTO class is supposed to use its email address property as its PK, and it also has a collection of RoleDTO objects as a property.</p>
  
  <p>Below is the only class I have inheriting from DbContext right now. I've commented out the other entity I have to try and reduce the problem.</p>
  
  <pre><code>class StorageContext : DbContext
  {
      public DbSet&lt;UserDTO&gt; Users { get; set; }
  
      protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
      {
          optionsBuilder.UseSqlServer("MySQLServerConnectionString")
      }
  
      protected override void OnModelCreating(ModelBuilder modelBuilder)
      {
          modelBuilder.Entity&lt;UserDTO&gt;().HasKey(entity =&gt; entity.Email);
          //modelBuilder.Entity&lt;UserDTO&gt;().HasMany(entity =&gt; entity.Roles);
      }
  }
  </code></pre>
  
  <p>And here is the UserDTO class. Can anyone see what's causing the error when I'm trying to make the migration?</p>
  
  <pre><code>internal class UserDTO
  {
      public EmailAddress Email { get; private set; }
  
      public string FullName { get; private set; }
  
      public string UserName { get; private set; }
  
      public virtual ICollection&lt;string&gt; Roles { get; private set; }
  
      // more below here like a constructor and some basic methods
  </code></pre>
  
  <p>If I switch the key for UserDTO to a plain string instead of the complext object EmailAddress it looks like it gets past that error and I get a different, equally interesting one:</p>
  
  <blockquote>
    <p>The property 'Roles' on entity type
    'Microsoft.SRE.NavisionOnline.ConfigurationAutomation.DAL.SQLEntities.UserDTO'
    has not been added to the model or ignored.</p>
  </blockquote>