title: Entity Framework 6 Foreign Key using strings and not to source model ID
body: <p>I have the following (abbreviated) models:</p>
  
  <pre><code>public class Item
  {
  public int id { get; set; }
  public string itemId { get; set; }
  ... more properties ...
  public virtual List&lt;Detail&gt; Details { get; set;}
  }
  
  public class Detail
  {
  [Key]
  public int id { get; set; }
  
  public string itemId { get; set; }
  ... more properties ...
  
  // Navigation property
  [ForeignKey("itemId")]
  public virtual Item Item { get; set; }
  }
  </code></pre>
  
  <p>If I use <code>itemId</code> as an int, it'll create the FK, however it'll link <code>Item.ID</code> to <code>Detail.itemId</code> - I'd like it to link <code>Item.itemId</code> to <code>Detail.itemId</code></p>
  
  <p>I'm sure it's something I'm missing in the decorations however it seems that EF want to always use the default ID.</p>
  
  <p>The reason I'm looking to do it this way is because the source data is linked via a string ID, which I can convert to a <code>int</code> but the limitation remains, that each table I'd prefer to have it's own <code>PK</code> until I can make sure the source data is robust enough.</p>