title: CodeFirst copies properties
body: <p>I have these two models:</p>
  
  <p><code>UserModel</code></p>
  
  <pre><code>[Table("user")]
  public class UserModel {
      [Key]
      [Column("emailaddress")]
      public string Emailaddress { get; set; }
  
      [Column("firstname")]
      public string Firstname { get; set; }
  
      [Column("lastname")]
      public string Lastname { get; set; }
  }
  </code></pre>
  
  <p><code>ContactPersonModel</code></p>
  
  <pre><code>[Table("contactperson")]
  public class ContactPersonModel {
      [Key]
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public int ID { get; set; }
  
      [Column("firstname")]
      public string Firstname { get; set; }
  
      [Column("lastname")]
      public string Lastname { get; set; }
  
      [Column("emailaddress")]
      [EmailAddress]
      [Index(IsUnique = true)]
      [MaxLength(255)]
      public string Emailaddress { get; set; }
  
      [Column("phonenumber")]
      [Phone]
      public string Phonenumber { get; set; }
  
      public virtual UserModel Creator { get; set; }
  }
  </code></pre>
  
  <p>This is the method I use to insert items in the database:</p>
  
  <pre><code>public async Task&lt;ContactPersonModel&gt; AddContactPerson(ContactPersonModel model) {
      dbmodel.ContactPerson.Add(model);
      dbmodel.Entry(model.Creator).State = EntityState.Unchanged;
      if (await dbmodel.SaveChangesAsync() == 0) {
          Log.ErrorFormat("cannot add contactperson {0}", model.Emailaddress);
          throw new Exception("cannot add contactperson");
      } else {
          await dbmodel.Entry(model).ReloadAsync();
          return model;
      }
  }
  </code></pre>
  
  <p>When I call the method <code>AddContactPerson</code> the properties <code>Firstname</code>, <code>Lastname</code> and <code>Emailaddress</code> get copied from the <code>UserModel</code> to the <code>ContactPersonModel</code> and overrides the values I set. How can I prevent this behavior?</p>