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.
我可以执行以下操作:
container.Users.Where(u => u.Name == "Omar").FirstOrDefault()
但
container.Users.FirstOrDefault(u => u.Name == "Omar")
返回一个NotSupportedException (The method 'FirstOrDefault' is not supported.)。
NotSupportedException (The method 'FirstOrDefault' is not supported.)
既然这些本质上是一样的,为什么不支持呢?
The LINQ Translation engine used by the OData provider doesn't handle every scenario.
While these are logically the same, the expression for each must be generated to build the query string. The engine doesn't support the second form.