I have a List<CustomClass> listOfCustomClass.
CustomClass is defined as follows :
public class CustomClass {
public name;
}
I want to search my List for a CustomClass of name “foo” and return a reference to this class. How can I do this ? The following is what I have attempted, however it returns “null”.
CustomcClass class = listOfCustomClass.Find(delegate(CustomClass findClass) {return findClass.name=="foo"; });
Use a linq query…