M
Mirek Endys
Is there a possibility to write an Predicate with param?
I need to look for a value in Array, or in List, but this value is variable.
How do I write something like this:
class MyObject
{
public Guid Id;
public string Caption;
}
List<MyObject> _myList = new List<MyObject>()
..... here is code for filling the list.....
now I need somehing like this:
private static bool MatchID(MyObject item, Guid id) // this is
impossible???
{
return (item.Id == id);
}
_myList.Find(MatchID, searchid) // this is impossible.... ????
Must I enumerate the List by foreach or is it possible to do it by another
way.
Thanks
I need to look for a value in Array, or in List, but this value is variable.
How do I write something like this:
class MyObject
{
public Guid Id;
public string Caption;
}
List<MyObject> _myList = new List<MyObject>()
..... here is code for filling the list.....
now I need somehing like this:
private static bool MatchID(MyObject item, Guid id) // this is
impossible???
{
return (item.Id == id);
}
_myList.Find(MatchID, searchid) // this is impossible.... ????
Must I enumerate the List by foreach or is it possible to do it by another
way.
Thanks