A problem with compare item value

Posted by Tony on Stack Overflow See other posts from Stack Overflow or by Tony
Published on 2010-03-13T17:22:33Z Indexed on 2010/03/13 17:35 UTC
Read the original article Hit count: 184

Filed under:
|
|

Hi, I have defined my class:

public class Host 
{
     public string Name;
}

then a strongly-typed dictionary:

Dictionary<string, Host> HostsTable;

then I try to compare a value:

 if (HostsTable.Values.Where(s => s.Name == "myhostname") != null) { doSomething }

and the problem is, nothing is found, even I'm sure the item is on the list. What I'm doing wrong ?

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about dictionary