var query = from _user in _dataContext.users where _user .userID == "1" join _order in _dataContext.orders on _user.ID equals _order.userID select new { user = _user, order = _order };
听闻可以用 CompiledQuery.Compile 对LINQ语句进行预编译提高性能
但搜了百度毫无头绪,特来请求前辈帮助一下,像上面那个在两个表中 返回两条数据的预编译 该怎么写啊。
谢谢了
解决方案
40
Take(数量),相似
var list = (from t in ctn.Items where t.DeliverySelection == true && t.Delivery.SentForDelivery == null orderby t.Delivery.SubmissionDate select t).Take(2);