locked
The context is already tracking a different entity with the same resource Uri RRS feed

  • Question

  • Hello,

    I get an exception "The context is already tracking a different entity with the same resource Uri." 

    Private Sub Duomenys_Validate(entity As Sąrašas, results As EntitySetValidationResultsBuilder)           

    Dim exists = (Me.Duomenys.Where(Function(x) (x.NR.ToUpper() = entity.NR.ToUpper() And x.Data < entity.Data And x.Id <> entity.Id)).FirstOrDefault() IsNot Nothing)

                If (exists = True) Then               

                    entity.Delete()

                End If

            End Sub

    What am I missing? I want to delete duplicate data  in local db.

    Thank you in advance.

    Tuesday, July 9, 2013 12:47 PM

Answers

All replies