Trying to get my head into Linq to Objects and for the life of me it escapes me...I want to get a list of all the products where the _name starts with J.
Product prod;
for (int i = 0; i < 10;i++ ) {
prod = new Product();
prod._Name = "J" + i.ToString();
prod._Surname = "F" + i.ToString();
}
Update
Product prod;
List<Product> productList = new List<Product>();
for (int i = 0; i < 10;i++ ) {
prod = new Product();
prod._Name = "J" + i.ToString();
prod._Surname = "F" + i.ToString();
productList.Add(prod);
}
var query = productList.Where(p=> p._Name.StartsWith("J"));
Thanks Jon