随笔分类 -  Ling to SQL学习笔记

摘要:这是一个延迟执行(Deferred excution)的问题。当调用where时,实际得到的不是集合,而是运算表达式,直到ToList时,他才成为对应的集合。在你的循环中,运算式中的变量值发生了变化(category),等同于如下代码,所以 levellist1 levellist2在执行时运算了相同的结果。 阅读全文
posted @ 2012-08-07 14:56 yzj1212 阅读(1277) 评论(0) 推荐(0)
摘要:student类public class Student{ public Student(int age,string name) { this.age = age; this.name = name; } public int age { get; set; } public string name { get; set; }}cs中List<Student> students=new List<Student>(); students.Add(new Student(15,"a")); students.... 阅读全文
posted @ 2012-07-17 10:45 yzj1212 阅读(116) 评论(0) 推荐(0)