Linq Where Simple 2

Hasan Akpürüm

Kıdemli Yazılım Danışmanı

Linq Where Simple 2

Yayınlanma 01 Ocak 0001
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

Thanks, your message is sent successfully. We will contact you shortly!

Yorumu Gönder