question about datasources for msdn Linq Samples

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
 
R

Rich P

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top