调试的时候,想看看iqueryable在tolist之前,有没有查询,
除非你调用asenumerable、tolist、toarray等,否则肯定是不会执行的。你可以打开sql server management studio,然后在工具菜单上找到profiler,用它可以拦截任何查询调用。