c# verify in class exist in list
Item wonderIfItsPresent = ...
bool containsItem = myList.Any(item => item.UniqueProperty == wonderIfItsPresent.UniqueProperty);'
c# verify in class exist in list
Item wonderIfItsPresent = ...
bool containsItem = myList.Any(item => item.UniqueProperty == wonderIfItsPresent.UniqueProperty);'
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.
list contains type c#
if (within.OfType<Ball>().Any())
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us