Answers for "check a object is in list of object c#"

3

check if list of objects contains value c#

bool contains = pricePublicList.Any(p => p.Size == 200);
Posted by: Guest on March-04-2020
0

c# object is in object list

public class A { public int Id {get;set;} public A() {} public A(int id) {Id = id;}}

List<A> list = new List<A>() { new A() { Id = 1}, new A() { Id = 2}};

bool containsItem = list.Any(item => item.Id == 3);
// this would return false.
Posted by: Guest on January-10-2021

Code answers related to "check a object is in list of object c#"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language