What is the VB.NET syntax for using List.FindAll() with a lambda?

mattgcon picture mattgcon · Sep 2, 2011 · Viewed 10.4k times · Source

In C# I have been performing a FindAll in a generic list as follows:

List<group.category> tlist = list.FindAll(p => p.parid == titem.catid);

Two questions, is this the appropriate way of performing such a thing and how do I convert this to VB.Net

Answer

Andrew Hare picture Andrew Hare · Sep 2, 2011

First, yes this is the appropriate way to do this and secondly:

Dim tlist As List(Of group.category) _
    = list.FindAll(Function(p) p.parid = titem.catid)