entity-framework/core/providers/cosmos/limitations.md
The Azure Cosmos DB database provider targets the Azure Cosmos DB NoSQL store, which is a document database. Most EF Core providers target relational databases. Document databases and relational databases behave in fundamentally different ways. EF Core does not attempt to hide these differences; rather EF Core provides common patterns that can be used successfully across both kinds of database, together with features tailored to a particular provider that follow best practices for a given type of database. If a feature of EF Core is a pit-of-failure for a certain kind of database, then typically the database provider will not implement that feature, and instead help steer uses towards a pit-of-success approach.
Common EF Core patterns that either do not apply, or are a pit-of-failure, when using a document database include:
[!WARNING] The Azure Cosmos DB SDK, which the EF provider uses, does not support synchronous I/O. As a result, synchronous EF APIs such as
ToListorSaveChangesthrow in version 9.0 and above; always use asynchronous methods when using EF. Previous versions of EF supported the synchronous APIs by calling.Wait()on the returnedTask; this is known as "sync over async", and is a highly discouraged technique that can lead to deadlocks. See the EF 9.0 breaking change note for more information.
Beyond the differences in relational and document databases, and limitations in the SDK, the EF Core provider for Azure Cosmos DB NoSQL does not include everything that could be implemented using the combination of EF Core and the Azure Cosmos DB SDK. Potential enhancements in this area are tracked by issues in the EF Core GitHub repo marked with the label area-cosmos The best way to indicate the importance of an issue is to vote (👍) for it. This data will then feed into the planning process for the next release.