Hasan Akpürüm
blog-post-1

Linq Where Simple 2

public void Linq2() {
List<Product> products = GetProductList();
var soldOutProducts =
from prod in products
where prod.UnitsInStock == 0
select prod;
Console.WriteLine("Sold out products:");
foreach (var product in soldOutProducts) {
Console.WriteLine("{0} is sold out!", product.ProductName);
}
}
public void Linq2() {    List<Product> products = GetProductList(); var soldOutProducts =        from prod in products        where prod.UnitsInStock == 0        select prod;        Console.WriteLine("Sold out products:");    foreach (var product in soldOutProducts) {        Console.WriteLine("{0} is sold out!", product.ProductName);    }} SONUÇ: Sold out products: Chef Anton's Gumbo Mix is sold out! Alice Mutton is sold out! Thüringer Rostbratwurst is sold out! Gorgonzola Telino is sold out! Perth Pasties is sold out!

Yorum Yaz