QuestionQ293

VerifiedData Manipulation

Given that the attached data table is stored in a variable named dt:

Question Image

Which of the following expressions throws an exception when it executes?

Explanation

No row has an Item value of "strawberry". Enumerable.First with a predicate throws an InvalidOperationException when the source contains no matching element, whereas FirstOrDefault returns the default value and Any returns False.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!