Parsing generic list

Hi,
I have an object, MyLists and there I have a member which holds a
List<Customers> lst, where Customers is another object.
Now, I receive outside, in a method of mine, as parameters, an entire object MyLists, and a string, CustomerName.
I need to parse the List<Customers> from MyLists parameter, to find the value of CustomerName, and return the index where I found it.

How can I parse List<Customers> and take the index ?

Thanks,
Daniela
[500 byte] By [DanielaTm] at [2007-11-19 19:58:29]
# 1 Re: Parsing generic list
foreach(Customers cust in lst){
if(cust.CustomerName == value){
return lst.IndexOf(cust);
}
}

Regards
Hansjrg
hansipet at 2007-11-9 11:20:18 >
# 2 Re: Parsing generic list
should be .Equals() unless you have overridden it
Techno at 2007-11-9 11:21:17 >
# 3 Re: Parsing generic list
Thank you,
Daniela
DanielaTm at 2007-11-9 11:22:16 >