title: How to ignore violation of primary key constraint in linq to sql
body: <p>I have a table where both fields (<code>idLocation, zipcode</code>) are used as the primary key:</p>
  
  <pre><code>CREATE TABLE [dbo].[locationZipCode](
      [idLocation] [int] NOT NULL,
      [zipcode] [char](5) NOT NULL,
      [state] [char](2) NULL,
      CONSTRAINT [locationZipCode_pk_idLocation_zipcode] PRIMARY KEY CLUSTERED ([idLocation], [zipcode])
   )
  </code></pre>
  
  <p>In my app I'm calling:</p>
  
  <pre><code>context.InsertAllOnSubmit(entities);
  context.SubmitChanges(ConflictMode.ContinueOnConflict);
  </code></pre>
  
  <p>And getting a duplicate key violation when duplicate records are attempted to be inserted. This is expected. If any records are duplicate then no records are inserted.  <strong>Is there anyway to ignore duplicate key exceptions and continue inserting any records that don't violate primary key constraints?</strong></p>
  
  <p>I realize I can validate duplication before calling <code>InsertAllOnSubmit()</code> in my app but it would be ideal if I could just catch the error and just continue with the inserts.</p>