DocumentDB IN keyword with Linq

2020-07-13 09:15发布

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?

2条回答
神经病院院长
2楼-- · 2020-07-13 10:03

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

查看更多
狗以群分
3楼-- · 2020-07-13 10:07

IN is not currently supported by the LINQ provider.

We will fix this in a future SDK update.

查看更多
登录 后发表回答