I\'m new to Entity Framework and this behavior confuses me:
[Table(\"ClinicProfile\")]
public class ClinicProfile
{
[Key]
[Databa
if you set to existing ClinicProfile new ContactData you should first save new ContactData to db, second get its new Id and third update ClinicProfile with new ContactDataId.
clinicProfile.ContactDataId = newContactData.Id;
SharedContext.Current.Entry(clinicProfile).State = EntityState.Modified;
SharedContext.Current.SaveChanges();
if you want to update existing ContactData properties then you should save only it.
SharedContext.Current.Entry(existingContactData).State = EntityState.Modified;
SharedContext.Current.SaveChanges();