Answers for "c# add value to list if not exists"

C#
1

c# verify in class exist in list

Item wonderIfItsPresent = ...
bool containsItem = myList.Any(item => item.UniqueProperty == wonderIfItsPresent.UniqueProperty);'
Posted by: Guest on May-19-2020
0

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)));
Posted by: Guest on October-19-2020

Code answers related to "c# add value to list if not exists"

C# Answers by Framework

Browse Popular Code Answers by Language