Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人对实体框架中缺少的这个特性有答案。有没有人可以解决实体框架中缺少的 Contains 方法?我已经在这里和通过谷歌尝试了一些,但它们似乎都没有真正起作用。
您可以考虑使用 EF 4.0,它也在 StartsWith、EndsWith 和许多其他地方实现。 ADO.NET 博客
正如已经回答的那样,Entity Framework 4.0 Beta 2 支持此方法,但需要下载 Visual Studio 2010 Beta 2。 在 Visual Studio 2008 SP1 中,您可以使用手动 LINQ 表达式构造(如此处所述)或 Entity SQL(如我们已在此处推荐的)。