'Invalid cast from 'System.Int32' to 'efcore_cosmosdb_bug.OperationStatus'.' - EF Core Azure Cosmos DB Provider #20916
Labels
area-cosmos
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
Milestone
I am using the EF Core Azure Cosmos DB Provider and trying to execute a query where I filter based on an enum value but I am getting "'Invalid cast from 'System.Int32' to 'efcore_cosmosdb_bug.OperationStatus'.'" error.
The problem is caused by the Status property of the class InitOperation.
There is also a conversion specified in the context but it does not seem to be helping.
The code that breaks is the following:
Steps to reproduce
efcore-cosmosdb-bug.zip
I have attached a project that demostrates the problem.
Just run the CosmosDb emulator, add the connection settings and run the program.
Further technical details
EF Core version: 3.1.3
Database provider: 3.1.3
Target framework: .NET Core 3.1
Operating system: Windows 7
IDE: Visual Studio Code
The text was updated successfully, but these errors were encountered: