Using Linq to Filter a list
So yesterday I made this post on applying a filter or map on a list. Now let’s have a look at how we can do this with Linq.
First the list:
Plain old Linq:
Using the Where extension method:
And for me the most readable:
You can even create your own Where method:
And you can use it like this:
I see so many uses and possibilities for the Linq style code as well as extension methods.