linq- This sample shows how to efficiently join elements of two sequences based on equality between key expressions over the two.
Dim categories() As String = {"Beverages", "Condiments", "Vegetables", "Dairy Products", "Seafood"}
Dim products = GetProductList()
Dim categorizedProducts = From cat In categories _
Join prod In products On cat Equals prod.Category _
Select Category = cat, prod.ProductName
For Each v In categorizedProducts
Console.WriteLine(v.ProductName & ": " & v.Category)
Next
Yorumlar
Yorum Gönder