打印Linq生成的SQL语句

var t1 = source.OrderBy<T>(orderby).Skip<T>(_skip).Take<T>(_take);
var t2 = t1.ToObjectQuery().ToTraceString();

不要用:
 source = source.OrderBy<T>(orderby).Skip<T>(_skip).Take<T>(_take).Future<T>().AsEnumerable().AsQueryable<T>();

Q:ObjectQuery和IQueryable之间的关系

A:https://www.cnblogs.com/fengxiaoling/p/4560741.html

原文地址:https://www.cnblogs.com/sunzhenyong/p/10848026.html