I
Isaac
Hello,
I'm using the Generic List class in System.Collection.Generics to
implement a strongly-typed list of my own class. I want to implement the
Find methods and have to use the Predicate delegate to do this.
As I understand it: I create a method which returns a bool and takes in
an object of type <T> where <T> is the type that the generic list was
created on.
Then I call the Find method like so:
myList.Find (new Predicate <T> (myFindMethod));
However, I am unclear as to what exactly myFindMethod should be doing -
what does it compare against or search for? Surely it isn't hard coded
to only find one particular item in the list. So what exactly should it do?
Thanks a lot
Isaac
I'm using the Generic List class in System.Collection.Generics to
implement a strongly-typed list of my own class. I want to implement the
Find methods and have to use the Predicate delegate to do this.
As I understand it: I create a method which returns a bool and takes in
an object of type <T> where <T> is the type that the generic list was
created on.
Then I call the Find method like so:
myList.Find (new Predicate <T> (myFindMethod));
However, I am unclear as to what exactly myFindMethod should be doing -
what does it compare against or search for? Surely it isn't hard coded
to only find one particular item in the list. So what exactly should it do?
Thanks a lot
Isaac