多项选择题
关于扩展方法的说法正确的是()
A.C#扩展方法所在的类必须是静态类。
B.C#扩展方法必须是静态方法。
C.C#扩展方法的第一个参数前必须加this。
D.C#扩展方法的调用与调用类型的实例方法一样。
点击查看答案&解析
相关考题
-
单项选择题
使用Lambda表达式获取班级所有学生的姓名,并去除重名,下列语法正确的是()
A.studentList.Select(StudentName.Distinct())
B.studentList.Select(StudentName).Distinct()
C.studentList.Select(t =>t.StudentName.Distinct())
D.studentList.Select(t =>t.StudentName).Distinct() -
单项选择题
使用Lambda表达式查找班级学生姓名含有“中”字的学生信息,下列语法正确的是()
A.studentList.FindAll(StudentName.Contains("中"))
B.studentList.FindAll(t =>t.StudentName.Contains("中"))
C.studentList.Select(StudentName.Contains("中"))
D.studentList.Select(t =>t.StudentName.Contains("中")) -
单项选择题
使用Lambda表达式对班级所有成绩求和,下列语法正确的是()
A.scoreList.Sum(ScoreValue)
B.scoreList.Sum(t =>t.ScoreValue)
C.scoreList.Count(ScoreValue)
D.scoreList.Count(t =>t.ScoreValue)