title: Entity Framework Adding Existing Item Causes Clone
body: <p>I'm using the Entity Framework v4 for a small project. Normally I use NHibernate. My issue is that I accidentally had code which added an object which was already persisted to the DB Context's collection, and when I did a SaveChanges(), the EF made a copy of the object, giving it a new Primary Key. </p>
  
  <p>While this is useful, it's not what I wanted. Is there a way to turn off that functionality, and instead have an exception thrown?</p>
  
  <p>UPDATE: CODE NOW INCLUDED</p>
  
  <pre><code>public class CcUser
  {
      public int Id { get; set; }
      [StringLength(50)]
      public string TrackingId { get; set; }
      [StringLength(50)]
      public string MembershipGuid { get; set; }
  
      public bool CookiesConfirmed { get; set; }
      [StringLength(200)]
      public string Email { get; set; }
  
      public DateTime Modified { get; set; }
  
  }
  
  public class MyDbContext : DbContext
  {
      public DbSet&lt;CcUser&gt; Users { get; set; }
  
  }
  
  MyDbContext db = new MyDbContext();
  
  var ccUser = db.Users.FirstOrDefault(u =&gt; u.TrackingId == id);   
  ccUser.Modified = DateTime.UtcNow;
  db.Users.Add(ccUser);
  db.SaveChanges();
  </code></pre>