Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DocumentDB IN keyword with Linq

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?

like image 340
Kjartan Valur Þórðarson Avatar asked Oct 19 '22 09:10

Kjartan Valur Þórðarson


2 Answers

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

like image 170
Mohamed Avatar answered Jan 04 '23 06:01

Mohamed


IN is not currently supported by the LINQ provider.

We will fix this in a future SDK update.

like image 33
Andrew Liu Avatar answered Jan 04 '23 07:01

Andrew Liu