Hello,
这个两个查询语句是有区别的,
你的第二个查询会先吧你实体类对于的表里的数据库全部load到你的应用程序内存里,然后这对这个内存对象(List<T>)执行查询,而第一个IQueryale<T>类型的,他会把你的查询翻译成相应的数据库语句然后发送到数据库段,然后执行查询。建议你追踪执行的sql
statement,看你的linq查询,你用的是EF的话,可以用db.Database.Log=Console.Write;
这个会把翻译后的sql
语句 输出到控制台窗口,看是什么问题。
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.