title: multiple added entities may have the same primary key on database seed
body: <p>assuming I have the following model structures for an asp.net mvc 5 app using entity framework 6</p>
  
  <pre><code>class Athlete {
   int AthleteID {get; set;}
   List&lt;YearsAsAthlete&gt; YearsAsAthlete {get;set;}
  }
  
  class YearsAsAthlete {
   int YearsAsAthleteID {get;set;}
   int AthleteID {get;set;}
   [ForeignKey("AthleteID")]
   Athlete Athlete {get;set;}
   List&lt;ContractRevenue&gt; ContractRevenue {get;set;}
   List&lt;AdvertisementRevenue&gt; AdvertisementRevenue {get;set;}
  }
  
  class ContractRevenue {
   int ContractRevenueID {get;set;}
   int YearsAsAthleteID {get;set;}
   [ForeignKey("YearsAsAthleteID")]
   YearsAsAthlete YearsAsAthlete {get;set;}
  
   List&lt;RevenueAmounts&gt; RevenueAmounts {get;set;}
  }
  
  class AdvertisementRevenue {get;set;}
   int AdvertisementRevenueID {get;set;}
   int YearsAsAthleteID {get;set;}
   [ForeignKey("YearsAsAthleteID")]
   YearsAsAthlete YearsAsAthlete {get;set;}
  
   List&lt;RevenueAmounts&gt; RevenueAmounts {get;set;}
  }
  
  class RevenueAmounts {
   int RevenueAmountsID {get;set;}
   int AmountPaid {get;set;}
   date DateOfPayment {get;set;}
  }
  </code></pre>
  
  <p>These models work fine when I have them like this, they have relationships and everything is delicious like a hot fudge sundae. When I run this, the database creates these tables and the RevenueAmounts table get 2 auto-generated foreign key columns for ContracRevenue and AdvertisementRevenue. </p>
  
  <p>However, I don't want these as they're named strangely (ContractRevenue_ContractRevenueID) and I need some way to access the foreginkey id property in my post controller method for adding new values that correlate with the right type of revenue.</p>
  
  <p>When I change the RevenueAmounts model to the following:</p>
  
  <pre><code>class RevenueAmounts {
   int RevenueAmountsID {get;set;}
   int AmountPaid {get;set;}
   date DateOfPayment {get;set;}
  
   // ***NOTE adding foreign keys here
  
   int ContractRevenueID {get;set;}
   [ForeginKey("ContractRevenueID")]
   ContractRevenue ContractRevenue {get;set;}
  
   int AdvertisementRevenueID {get;set;}
   [ForeignKey("AdvertisementRevenueID")]
   AdvertisementRevenue AdvertisementRevenue {get;set;}
  }
  </code></pre>
  
  <p>I start getting an exception:</p>
  
  <p>[SqlException (0x80131904): Introducing FOREIGN KEY constraint 'FK_dbo.AdvertisementRevenue_dbo.YearsAsAthlete_YearsAsAthleteID' on table 'AdvertisementRevenue' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.</p>
  
  <p>** <strong><em>EDIT</em></strong> **</p>
  
  <p>I've turned off the cascading delete functionality using the fluent API however now I'm getting a different exception:</p>
  
  <p>Unable to determine the principal end of the 'GIP.DAL.ContractRevenue_RevenueAmounts' relationship. Multiple added entities may have the same primary key.</p>
  
  <p>By the way, the exception is being thrown when I'm trying to seed a bunch of info into the database and then doing <code>context.SaveChanges()</code> at the bottom (only doing it once at the end)</p>