Answers for "c# get list of an object is contained in"

C#
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
0

c# check list of objects for value

var matches = myList.Where(p => p.Name == nameToExtract);
Posted by: Guest on July-27-2020

Code answers related to "c# get list of an object is contained in"

C# Answers by Framework

Browse Popular Code Answers by Language