DocumentDB IN keyword with Linq

无人久伴 提交于 2020-01-13 00:30:55

问题


You can now create IN queries with DocumentDB like this:

SELECT *
FROM Families 
WHERE Families.id IN ('AndersenFamily', 'WakefieldFamily')

But if I run a similar query with Linq I get an error {"Method 'Contains' is not supported."}

.where(a => familyNames.Contains(a.Families))

How can I crate IN queries with Linq?


回答1:


IN is not currently supported by the LINQ provider.

We will fix this in a future SDK update.




回答2:


This is fixed now, what you have should work with the new SDK releases.



来源:https://stackoverflow.com/questions/30870123/documentdb-in-keyword-with-linq

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!