How can I translate the Lambda operator functions in this C# example?

How can I translate the Lambda operator functions in this C# example?

I understand there are multiple questions about this subject and I have read the Microsoft documentation regarding the operator. I also understand that this question will likely be downvoted but I still would appreciate any help in finding the right direction to look.

I understand there are multiple questions about this subject and I have read the Microsoft documentation regarding the operator. I also understand that this question will likely be downvoted but I still would appreciate any help in finding the right direction to look.

I am trying to understand this block of code:

List<string> selectedValues = CheckBoxList1.Items.Cast<ListItem>()
    .Where(li => li.Selected)
    .Select(li => li.Value)
    .ToList();

From my research I understand the point of the Lambda function (to provide a function that can be used as a parameter in-line) but why in this case is it being used?

To add only items to selectedValues that are li.Selected, and only add the value of those selected items to the list called selectedValues? If this is the case, is there no other more readable way to do so? How else could this be written? Is my understanding correct?

Thanks for your time.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

C/C++ vs. Rust: A developer’s perspective

In this post, you'll see the difference between Rust and C/C++ in a developer’s perspective

Variable Introduction in C#[Bangla]

LIKE | COMMENT | SHARE | SUBSCRIBE A variable is nothing but a name given to a storage area that our programs can manipulate. Each variable in C# has a speci...