我可能比较蠢,但是在VS whisper帮助中,
问题是我正在尝试在where语句中使用contains,但在一些在SO上找到的解决方案中,它会抛出错误,提示我的最佳重载方法具有一些无效参数(该方法是
我的代码像这样:
contains
和contains<>
有什么区别?有时我都会得到这两种内容,有时只有带有<>的那个。问题是我正在尝试在where语句中使用contains,但在一些在SO上找到的解决方案中,它会抛出错误,提示我的最佳重载方法具有一些无效参数(该方法是
System.Linq.ParallelEnumerable.Contains<TSource>(...)
)。我的代码像这样:
defaultDL = db.SomeEntity
.Where(dl => dl.Something == this.Something
&& (dl.AllLocation == true || this.SomeOtherEntity.Select(loc => loc.Location).Contains(dl.Location)))
.ToList();
Contains<>
不存在。也许你的意思是Contains<T>
? - Camilo Terevinto