Hi All
I'm trying to use a Generic.List declared as follows (Example):
Public Class MyObj
{
Public String Name;
Public Integer Age;
}
Public Class GenericTest
{
private System.Collections.Generic.List<MyObjTheList;
Public void Search()
{
string SearchForName = "Michael";
MyObj FoundObj;
FoundObj = TheList.Find(FindByName)
}
private bool FindByName(MyObj obj)
{
if (obj.Name == ???)
return true
else
return false;
}
}
I would like to find instances og MyObj by passing a Name value, but I can't
seem to find out how to make a Predicate that can do just that.
How do I pass the SearchForName to the Delegate/predicate ?????
Anyone has some code that will help me out here
THanks in advance
Allan Bredahl