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
Describe the bug
I'm encountering an issue while attempting to filter Cosmos DB documents using OData and EntityFramework. My document structure consists of a Parent entity containing a Child object, as defined below:
public class Parent
{
public Child Child { get; set; }
}
public class Child
{
public Guid MyGuid { get; set; }
}
I'm trying to filter all Parent documents where the Child.MyGuid property matches any value in a given GUID list. Here's an example query I'm using: $filter=Child/MyGuid in (dcb9d3f9-3133-48c6-864c-6fc0037584d4)
However, I'm encountering the following exception: "Method 'Cast' is not supported., Windows/10.0.19045 cosmos-netstandard-sdk/3.19.1"
"type": "Microsoft.Azure.Cosmos.Linq.DocumentQueryException",
"stacktrace": " at Microsoft.Azure.Cosmos.Linq.ArrayBuiltinFunctions.Visit(MethodCallExpression methodCallExpression, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ExpressionToSql.VisitNonSubqueryScalarExpression(Expression expression, ReadOnlyCollection`1 parameters, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ExpressionToSql.VisitScalarExpression(Expression expression, ReadOnlyCollection`1 parameters, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ArrayBuiltinFunctions.ArrayContainsVisitor.VisitImplicit(MethodCallExpression methodCallExpression, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.BuiltinFunctionVisitor.Visit(MethodCallExpression methodCallExpression, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ArrayBuiltinFunctions.Visit(MethodCallExpression methodCallExpression, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ExpressionToSql.VisitNonSubqueryScalarExpression(Expression expression, ReadOnlyCollection`1 parameters, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ExpressionToSql.VisitScalarExpression(Expression expression, ReadOnlyCollection`1 parameters, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ExpressionToSql.VisitBinary(BinaryExpression inputExpression, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ExpressionToSql.VisitNonSubqueryScalarExpression(Expression expression, ReadOnlyCollection`1 parameters, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ExpressionToSql.VisitScalarExpression(Expression expression, ReadOnlyCollection`1 parameters, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ExpressionToSql.VisitWhere(ReadOnlyCollection`1 arguments, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ExpressionToSql.VisitMethodCall(MethodCallExpression inputExpression, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ExpressionToSql.Translate(Expression inputExpression, TranslationContext context)
I found the generated query from EntityFramework is
Not sure if the error is on EntityFramework side or CosmosDB client side, could you let me know how can I resolve this issue and successfully filter the Parent documents based on the Child.MyGuid property?
Environment summary
SDK Version: 3.19.0
OS Version (e.g. Windows, Linux, MacOSX): Windows
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm encountering an issue while attempting to filter Cosmos DB documents using OData and EntityFramework. My document structure consists of a Parent entity containing a Child object, as defined below:
A sample JSON document looks like this:
I'm trying to filter all Parent documents where the Child.MyGuid property matches any value in a given GUID list. Here's an example query I'm using:
$filter=Child/MyGuid in (dcb9d3f9-3133-48c6-864c-6fc0037584d4)
However, I'm encountering the following exception:
"Method 'Cast' is not supported., Windows/10.0.19045 cosmos-netstandard-sdk/3.19.1"
I found the generated query from EntityFramework is
Not sure if the error is on EntityFramework side or CosmosDB client side, could you let me know how can I resolve this issue and successfully filter the
Parent
documents based on theChild.MyGuid
property?Environment summary
SDK Version: 3.19.0
OS Version (e.g. Windows, Linux, MacOSX): Windows
The text was updated successfully, but these errors were encountered: