////////////////////////////
///以下是Group,Distinct,Union,Concat,Intersect,Except的例子和解释
/////////////////////////////
class Program
{
DB
static void Main(string[] args)
{
List<Student> studentList = GetStudents();
//Group(studentList);
//Distinct(studentList);
//Union(studentList);
//Concat(studentList);
Intersect(studentList);
//Except();
}
Group,Distinct,Union,Concat,Intersect,Except
private static IEnumerable<Student> RevealChangeType<T>(T obj)
{
IEnumerable<Student> student = obj as IEnumerable<Student>;
return student;
}
}
sealed class Student
{
public int age;
public int Age
{
get { return age; }
set { age = value; }
}
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
private string language;
public string Language
{
get { return language; }
set { language = value; }
}
}
///以下是Group,Distinct,Union,Concat,Intersect,Except的例子和解释
/////////////////////////////
class Program
{
DB
static void Main(string[] args)
{
List<Student> studentList = GetStudents();
//Group(studentList);
//Distinct(studentList);
//Union(studentList);
//Concat(studentList);
Intersect(studentList);
//Except();
}
Group,Distinct,Union,Concat,Intersect,Except
private static IEnumerable<Student> RevealChangeType<T>(T obj)
{
IEnumerable<Student> student = obj as IEnumerable<Student>;
return student;
}
}
sealed class Student
{
public int age;
public int Age
{
get { return age; }
set { age = value; }
}
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
private string language;
public string Language
{
get { return language; }
set { language = value; }
}
}