Yes, I do query for an existing entity before I create a new one and if the IList has a count >0 then the If condition skips adding a new entity and throws an exception instead.
Similarly, my construct has the ability to use the Existing entity for the child if the parent already exists.
This works great if you are adding one parent entity as a one time thing. In my case I’m adding about 40 child Records and each record has a unique constraint that is a combination of two parents. In which case the query+check has to be performed for each child record.
For 40 records, that is 40 Select queries running against the Data Service, followed by another 40 insert queries. I was thinking if there was a unique constraint imposed, then we could try to insert the record straight away and trap the exception.
thanks for the quick response!