SingleOrDefault() method: what is "a default value"?

Viewed 20488

I'm testing for the existence of a user record in the following statement:

if (fromUser.AllFriends.Where(af => af.FriendUserID == toUserID).SingleOrDefault() == ???

Given the documentation:

Returns a single, specific element of a sequence, or a default value if that element is not found.

What does the bold text refer to? What the heck am I testing for in my if statement?

A serious question that probably sounds simple and ridiculous to most.

Thanks.

6 Answers
Related