Entity Framework - how to save entity without saving related objects <p>In my Entity Framework, I have three related entities '<strong>Client</strong>', '<strong>ClientAddress</strong>' and '<strong>LookupAddressType</strong>'. "<strong>LookupAddressType</strong>" is a master class specifying the type of available address type, like business address, residential address etc. <strong>ClientAddress</strong> depend on <strong>LookupAddresstype</strong> and <strong>Client</strong>. While <strong>saving</strong> a <strong>Client</strong> entity with relevant ClientAddress data, i'm getting following error.</p> <blockquote> <p>"Violation of PRIMARY KEY constraint 'PK_LookupAddressType'. Cannot insert duplicate key in object 'dbo.LookupAddressType'. The statement has been terminated.</p> </blockquote> <p>I do not need LookupAddressType to be inserted. Here I just need the relevant lookupAddressTypeId to be inserted in clientAddress entity.</p> <p>The Saving code is like this:</p> <pre><code>Add(Client); _objectContext.SaveChanges(); </code></pre> <p>how can i do this?</p> <p>The Load Code is below:</p> <pre><code>private void LoadClientDetails(EFEntities.Client _Client) { EFEntities.LookupClientStatu clientStatus; var clientAddressList = new List&lt;ClientAddress&gt;(); if (_Client == null) { return; } //Assign data to client object _Client.ClientName = rtxtName.Text; _Client.Alias = rtxtAlias.Text; _Client.ClientCode =Int32.Parse(rtxtClientCode.Text); _Client.TaxPayerID = rtxtTaxPayerId.Text; if (rcboStatus.SelectedIndex != 0) { clientStatus = new EFEntities.LookupClientStatu { ClientStatusID = (Guid) (rcboStatus.SelectedValue), ClientStatusDescription = rcboStatus.Text }; _Client.LookupClientStatu = clientStatus; } //_Client.Modified = EnvironmentClass.ModifiedUserInstance.Id; _Client.EffectiveDate = rdtEffectiveDate.Value; if (rdtExpDate.Value != rdtExpDate.MinDate) { _Client.ExpirationDate = rdtExpDate.Value; } else { _Client.ExpirationDate = null; } _Client.StartDate = DateTime.Now; EFEntities.ClientAddress clientAddress = null; // Iesi.Collections.Generic.ISet&lt;ClientAddress&gt; clientAddress = new HashedSet&lt;ClientAddress&gt;(); foreach (var cAddress in _clientController.client.ClientAddresses) { clientAddress = cAddress; break; } if (clientAddress == null) { clientAddress = new EFEntities.ClientAddress(); } clientAddress.Address1 = rtxtClientAdd1.Text; clientAddress.Address2 = rtxtClientAdd2.Text; clientAddress.Address3 = rtxtClientAdd3.Text; // Address type details if (rcboClientAddType.SelectedIndex != -1) { clientAddress.LookupAddressType = new EFEntities.LookupAddressType { AddressTypeID = (Guid) (rcboClientAddType.SelectedValue), AddressTypeDescription = rcboClientAddType.Text }; //clientAddress.AddressType.Id = Convert.ToByte(rcboClientAddType.SelectedValue); } clientAddress.City = rtxtClientCity.Text; clientAddress.Client = _Client; </code></pre> <p>\</p> <pre><code> _Client.ClientAddresses.Add(clientAddress); } </code></pre>