AWestEng
asked on
Convert Dictionary foreach search to Linq
Hi
is it possible to convert this code to use Linq instead?
is it possible to convert this code to use Linq instead?
private bool Exists(string name)
{
foreach (ClientData p in _clients.Keys)
{
if (p.Id.Equals(name, StringComparison.OrdinalIgnoreCase))
{
return true;
}
}
return false;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not a problem, that happens. Have a great day. ;=)
If you want, you can request reopen and split. I won't object to that. FernandoSoto put in quite some effort, though I believe his solution is about the same as what I showed (though slightly more verbose perhaps).
No need to do that, it is really not a problem. ;=)
ASKER
Thx guys,, perfect job
Thanks AWestEng and abel. ;=)
ASKER
No! Thank you guys! Thx for always put your own time into others problem and help out.
I really appreciate it . :)
I really appreciate it . :)
you're welcome, both, always around to help (almost) :)
ASKER