ManyToMany relationship - Add if not exist

Issue #32 invalid
piotrek1231 created an issue

Hi, I have ManyToManyRelationship. Table X can has many objects of Y. In first step, I add Objects X with 2 objects Y(this objects have id: 50, 51). Next I want to add next X - if the objects Y have different id from 50 and 51, it's OK, but sometimes objects Y have the same id. In this situation I want to add only relations in XY table without adding new row in Y.

I have set CascadeOperations = CascadeOperation.All in Y. How I can resolve this issue ?

Comments (1)

  1. Guillermo GutiƩrrez

    The only way to automatically handle this situation is using InsertOrReplaceWithChildren method. Otherwise you'll need to keep track of the changes yourself.

    Please ask this kind of questions in StackOverflow, this is a issue tracking tool. That way other users may find the same question and the response. I'm notified when a new sqlite-net-extension-tagged question is created anyway.

  2. Log in to comment