// var products = from product in ProductList select product.Name;
// var products = ProductList.Select(a => new Product { Name = a.Name, Code = a.Code }).ToList();
//2............Exclude duplicates get Distinct.
// var products = ProductList.Select(p => p.Name).Distinct();
////var products = from product in ProductList
//// select product.Name.Distinct();
//3.............where condition
//var products = from product in ProductList
// where product.Name == "apple"
// select product.Name;
//checks existence of a keyword
List
where u.Name.Contains("apple")
select u;
//check records that start with the keyword
List
where u.Name.StartsWith("apple")
select u;
//check record that end with the keyword
List
where u.Name.EndsWith("apple")
select u;
No comments:
Post a Comment