M
Mike P
I am running through the LINQ examples on the Microsoft site and I am
wondering where the List object below is coming from? What classes do I
need to add to my page to be able to use this List object?
public void Linq3() {
List products = GetProductList();
var expensiveInStockProducts =
from p in products
where p.UnitsInStock > 0 && p.UnitPrice > 3.00M
select p;
Console.WriteLine("In-stock products that cost more than 3.00:");
foreach (var product in expensiveInStockProducts) {
Console.WriteLine("{0} is in stock and costs more than 3.00.",
product.ProductName);
}
}
wondering where the List object below is coming from? What classes do I
need to add to my page to be able to use this List object?
public void Linq3() {
List products = GetProductList();
var expensiveInStockProducts =
from p in products
where p.UnitsInStock > 0 && p.UnitPrice > 3.00M
select p;
Console.WriteLine("In-stock products that cost more than 3.00:");
foreach (var product in expensiveInStockProducts) {
Console.WriteLine("{0} is in stock and costs more than 3.00.",
product.ProductName);
}
}