混淆linq和IEnumerable或IList

时间:2009-10-03 04:04:28

标签: linq-to-sql

如果GetAddresses()返回IList,有人可以解释为什么我在'results'语句中得到'没有翻译到sql'错误但是如果它返回IEnumerable则没有?

var addresses= GetAddresses(dataContext);

results = results.Where(r => r.People.Any(a => Addresses.Contains(a)));

1 个答案:

答案 0 :(得分:0)

你试过了吗?

 results = results.Where(r => r.People.Any(a => Addresses.Contains(a))).ToList();