title: Adding row to relational table - linq to sql
body: <p>I have 3 primary Tables -  <code>Picture, Album and Collage</code>. <code>Collage</code> and <code>Album</code> can have 1-many pictures. Pictures do not have to be in <code>Album</code> to be added to the <code>Collage</code>. </p>
  
  <p>To define their relationship, I have <code>AlbumPicture</code> and <code>CollagePicture</code> tables.</p>
  
  <p>My problem is when I try to add picture already uploaded to the <code>Collage</code> and hence to the <code>CollagePicture</code> table. It throws primry key violation error on <code>PK_Picture</code> since picture already exists.</p>
  
  <pre><code>CollagePictures.InsertOnSubmit(new CollagePicture {Collage = CollagePicture = existingPic});
  </code></pre>
  
  <p>I need to add one record in <code>CollagePicture</code> for existing picture and new <code>Collage</code>. Is there any way I can tell linq to not add picture if it already exists?</p>
  
  <p>I am new to Linq and still learning.</p>
  
  <p>EDIT:
  sorry If I was not clear.
  I assign PK to Picture as GUID when Pictures are uploaded. In CollagePicture I already have this pictureId with different collage</p>
  
  <p>e.g.</p>
  
  <pre><code>CollagePictureId [PK]= 1
  CollageId=1
  PictureId = 1234567890123456
  </code></pre>
  
  <p>Now I want to add same Picture with different CollageId say,2. When I try to add anything to <code>CollagePicture</code> it tries to add to the <code>Picture</code> table as well. and that is when I get an exception. Hope this will clear things up.</p>