查询""班的学生人数-LINQ和Lambda

SQL查询'95031'班的学生人数: select count(*) from student where class = '95031'

LINQ查询'95031'班的学生人数: (from s in Students where s.CLASS == "95031" select s ).Count()

Lambda查询'95031'班的学生人数: Students.Where( s => s.CLASS == "95031" ).Select( s => s).Count()

count统计函数

ppt 文件大小:356KB