title: DatabaseGeneratedOption.None not working in Entity Framework 6
body: <p>I need to manually enter primary key values in a database, as i need the key values to be in sync with an Enum.  However using DatabaseGeneratedoption.None doesn't appear to work. Even when i delete the database and start fresh, the Id column in the JobType still has an auto-incrmeneting primary key.</p>
  
  <p>Is it anything to do with the fact that i'm using an enum as a primary key?</p>
  
  <p>Job Entity</p>
  
  <pre><code>public class Job : EntityBase
  {
      public long JobId { get; set; }       
      public JobTypeEnum JobTypeId { get; set; }
      public JobType JobType { get; set; }      
  }
  </code></pre>
  
  <p>Job Type</p>
  
  <pre><code>public class JobType 
  {         
      public JobTypeEnum Id { get; set; }
      public String Name { get; set; }
      public String Description { get; set; }       
  }
  </code></pre>
  
  <p>Configuration Classes</p>
  
  <pre><code>public class JobTypeConfiguration : EntityTypeConfiguration&lt;JobType&gt;
  {
      public JobTypeConfiguration()
      {
          HasKey(x =&gt; x.Id);
          Property(x =&gt; x.Id)
              .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
          Property(x =&gt; x.Name).HasMaxLength(20);
          Property(x =&gt; x.Description).HasMaxLength(255);
      }
  }
  
  public class JobConfiguration : EntityTypeConfiguration&lt;Job&gt;
  {
      public JobConfiguration()
      {
          HasKey(x =&gt; x.JobId);
          Property(x =&gt; x.JobId)
              .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);          
           HasRequired(x =&gt; x.JobType).WithMany().HasForeignKey(x =&gt; x.JobTypeId);
  
      }
  }
  </code></pre>
  
  <p>Model Builder</p>
  
  <pre><code>modelBuilder.Configurations.Add(new JobConfiguration());
  modelBuilder.Configurations.Add(new JobTypeConfiguration());
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I've tracked down a probable cause. I have a Migration that creates tables for Elmah. If i exclude that migration, then it works fine. If i include it, then it doesn't. </p>
  
  <p>Bizarre...</p>