question about datasources for msdn Linq Samples

  • Thread starter Thread starter Rich P
  • Start date Start date
R

Rich P

I am trying out an msdn linq sample from

http://msdn.microsoft.com/en-us/vcsharp/aa336760.aspx

public void Linq2() {
List products = GetProductList();

var soldOutProducts =
from p in products
where p.UnitsInStock == 0
select p;

Console.WriteLine("Sold out products:");
foreach (var product in soldOutProducts) {
Console.WriteLine("{0} is sold out!", product.ProductName);
}
}

//--Searching msdn I find GetProductList();

public List GetProductList() {
productList = new List { { ProductID = 1, ProductName = "Chai", Category
= "Beverages", UnitPrice = 18.0000M, UnitsInStock = 39 }, ...
}

my question is if I need to create a producList class for the
GetProductList() sample datasourece - or does msdn have a class already
created out there? If I have to create it - what would it look like?
Or could I just pull some sample data from Adventureworks?

Thanks

Rich
 
Back
Top