title: An entity with the same identity already exists in this EntitySet
body: <p>I'm trying to peform an update statement using WCF RIA Services, but everytime I update I keep getting "An entity with the same identity already exists in this EntitySet. Any insight on where I can start looking or figuring out what is wrong?</p>
  
  <p>Step 1 </p>
  
  <pre><code>LoadOperation&lt;Analysis&gt; AnalysisLP = ((App)Application.Current)._context.
                  Load(((App)Application.Current)._context.GetAnalysisQuery().
                  Where(o =&gt; o.ProjectID == Convert.ToInt32(((App)Application.Current).Project.ProjectID)));
  </code></pre>
  
  <p>Step 2  </p>
  
  <pre><code> AnalysisLP.Completed += delegate
              {
                  if (!AnalysisLP.HasError)
                  {
                      Analysis = AnalysisLP.Entities.FirstOrDefault();
  };
  </code></pre>
  
  <p>Step 3</p>
  
  <pre><code>         ((App)Application.Current)._context.Analysis.Attach(Analysis);
           ((App)Application.Current)._context.SubmitChanges(OnSubmitCompleted, null);
  </code></pre>
  
  <p>Can anyone help me, what is it i'm doing wrong??
  thanks</p>