AddRange

Posts   
 
    
Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 26-Apr-2010 17:31:16   

Hello,

Just like to know the expected behavior of the function "AddRange" on a collection.

What happen if I try to add another object, in fact the same one from another fetch with the same key ?

1 - Exception 2 - 2 entities in the collection 3 - only the previous one will exists in the collection 4 - only the last one will be in the collection

Thanks, Eric

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 26-Apr-2010 18:23:06   

It depends on the value of the collection's DoNotPerformAddIfPresent property. Which is true by default.

if(DoNotPerformAddIfPresent) { 3 - only the previous one will exists in the collection } else { 2 - 2 entities in the collection }

Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 26-Apr-2010 18:25:27   

Thanks a lot Walaa !