How should you rewrite lines 03 through 06 of the method?

You have a List object that is generated by executing the following code:

You have a method that contains the following code (line numbers are included for reference only):

You need to alter the method to use a lambda statement.
How should you rewrite lines 03 through 06 of the method?

You have a List object that is generated by executing the following code:

You have a method that contains the following code (line numbers are included for reference only):

You need to alter the method to use a lambda statement.
How should you rewrite lines 03 through 06 of the method?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 6

Your email address will not be published. Required fields are marked *


Jio

Jio

D: There is no “Exist” Enumerable in Namespace: System.Linq

Jio

Jio

C is correct as this is not linq, it is List

Artem

Artem

Return type is bool. A, B, D return not bool.

Darlington

Darlington

Correct. Good thing you picked on that.

Lord Vader

Lord Vader

very interesting. very well spotted by Artem. these are method based queries i.e extension methods.
these methods extend any variable that implements the Ienumerable interface. method based queries take a lamba expression as a parameter which represents the logic to be performed while enumerating through the sequence.

Return type is bool. A, B, D return not bool.

all are valid but Return type is bool. A, B, D return not bool.