//definition of an array which can be inumerable
People[] peoples = new People[] {
new People("Li", "C#"),
new People("zhang", "C++"),
new People("Smith", "C++")
};
// Linq expression
IEnumerable<string> peoples_cpp =
from d in peoples
where d._language == "C++"
select d._name;
// it's counterpart first
IEnumerable<string> peoples_cpp =
peoples.Where(d => d._language == "C++").Select(d => d._name);
// it's counterpart first
Func<People, bool> filtering = d => d._language == "C++";
Func<People, string> selectPredicate = d => d._name;
IEnumerable<string> peoples_cpp =
peoples.Where(filtering).Select(selectPredicate);
People[] peoples = new People[] {
new People("Li", "C#"),
new People("zhang", "C++"),
new People("Smith", "C++")
};
// Linq expression
IEnumerable<string> peoples_cpp =
from d in peoples
where d._language == "C++"
select d._name;
// it's counterpart first
IEnumerable<string> peoples_cpp =
peoples.Where(d => d._language == "C++").Select(d => d._name);
// it's counterpart first
Func<People, bool> filtering = d => d._language == "C++";
Func<People, string> selectPredicate = d => d._name;
IEnumerable<string> peoples_cpp =
peoples.Where(filtering).Select(selectPredicate);