Answers for "check if item exists in list c# linq"

2

linq object list contains

using System.Linq;

bool exists = list.Any(x => x.surname == "Smith");
Posted by: Guest on August-03-2020
0

linq check if exists in list

using System.Linq;
...
    bool has = list.Any(cus => cus.FirstName == "John");
Posted by: Guest on February-17-2021

Browse Popular Code Answers by Language