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;
                }
            }
vivekj2004Asked:
Who is Participating?
 
morguloConnect With a Mentor Commented:
Yes, each status from statuses is searched in excludeStatuses collection. You can read this as: if status from statuses exists in excludeStatuses it's bad status.
0
 
p_davisCommented:
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.
0
 
jdavistxCommented:
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.
0
 
vivekj2004Author Commented:
All the answers were decent except for this answer, which was perfectly described in english.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.