You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added ArrayContains to CosmosLinqExtensions to allow partial matching
The `Array_Contains` funtion CosmosDB Sql has a 3rd parameter which allows it to do a partial match on the given item. This is unable to be called with the built in Linq `array.Contains(item)` extension methods.
This adds this adds an explicit mapping to this function to allow it to be called in Linq like this:
`documents.Where(document => document.ObjectArray.ArrayContains(new { Name = "abc" }, true))`
newLinqTestInput("ArrayContains in Select clause with int value and match partial true", b =>getQuery(b).Select(doc =>doc.ArrayField.ArrayContains(1,true))),
362
+
newLinqTestInput("ArrayContains in Filter clause with int value and match partial true", b =>getQuery(b).Where(doc =>doc.ArrayField.ArrayContains(1,true))),
363
+
newLinqTestInput("ArrayContains in Select clause with object value and match partial true", b =>getQuery(b).Select(doc =>doc.ObjectArrayField.ArrayContains(new{Field="abc"},true))),
364
+
newLinqTestInput("ArrayContains in Filter clause with object value and match partial true", b =>getQuery(b).Where(doc =>doc.ObjectArrayField.ArrayContains(new{Field="abc"},true))),
365
+
366
+
newLinqTestInput("ArrayContains in Select clause with int value and match partial false", b =>getQuery(b).Select(doc =>doc.ArrayField.ArrayContains(1,false))),
367
+
newLinqTestInput("ArrayContains in Filter clause with int value and match partial false", b =>getQuery(b).Where(doc =>doc.ArrayField.ArrayContains(1,false))),
368
+
newLinqTestInput("ArrayContains in Select clause with object value and match partial false", b =>getQuery(b).Select(doc =>doc.ObjectArrayField.ArrayContains(new{Field="abc"},false))),
369
+
newLinqTestInput("ArrayContains in Filter clause with object value and match partial false", b =>getQuery(b).Where(doc =>doc.ObjectArrayField.ArrayContains(new{Field="abc"},false))),
Copy file name to clipboardExpand all lines: Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj
0 commit comments