Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to add to a list only items that are not already in the list c#

CurrentCollection.AddRange(NewItems.Where(x => !CurrentCollection.Any(y => y.valueToCheck == x.valueToCheck)));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #list #items #list
ADD COMMENT
Topic
Name
9+4 =