Skip to content

EFCore 3.1 + CosmosDb can't translate any() on owned object #20441

@darthg8r

Description

@darthg8r

I have a query that seems to be pretty basic. I'm using Core3.1 on top of CosmosDb. I simply want to query a list of orders that have order details, but I'm getting this error:

.Where(b => EF.Property>(b, "OrderDetails") .Any())' could not be translated. Either rewrite the query in a form that can be translated or switch to client evaluation.

Client evaluation isn't an option

Consider this contrived example:

public class Order
{
    public List<OrderDetail> OrderDetails {get;set;}
}

public class OrderDetail
{

}

// Db Context
modelBuilder.Entity<Order>().OwnsMany(x => x.OrderDetails);


// The query
context.Orders.Where( order => order.OrderDetails.Any());

I do this in my sleep with SQL. What gives?

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions