Ashif Nataliya
Ashif Nataliya

Reputation: 922

how to filter list which is inside List of class using linq?

class A
{
    List<Package> productPackages;
}


static void Main(string[] args)
    {
        List<A> mainProductListing;
    }

How can I filter mainProductListing.productPacakge where productPackage.fileName="somefile.msi" usin Linq?

Upvotes: 2

Views: 7148

Answers (1)

Sajeetharan
Sajeetharan

Reputation: 222582

var list = mainProductListing.Where(t=>t.productPackages.Any(s=>s.fileName == "somefile.msi"));

Upvotes: 7

Related Questions