Link to home
Start Free TrialLog in
Avatar of vivekj2004
vivekj2004

asked on

C#

what is the meaning of o in the code following... does it point to status in the foreach loop.

foreach (var status in statuses)
            {
                if (excludeStatuses.Exists(o => o.Equals(status)))
                {
                    badStatus = true;
                }
            }
Avatar of p_davis
p_davis

its looping through each instance of the object in statuses

then it is looking in (most likely) a list to see if that current object exists in it if it does then it sets the bool badStatus to true.
o is the same type as that of the excludeStatuses collection.  I'm assuming it's of type Status.

So, if this excludeStatus collection contains a status element that matches the status value being evaluated, then set badStatus = true.
ASKER CERTIFIED SOLUTION
Avatar of morgulo
morgulo
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vivekj2004

ASKER

All the answers were decent except for this answer, which was perfectly described in english.