About cosmos-provider
A skill for working with the Entity Framework Core provider for Azure Cosmos DB. It explains provider-specific data modeling, query and concurrency behavior, and emulator-based testing considerations.
Key features
- 01Non-relational query pipeline
- 02JSON document materialization
- 03Embedded owned and complex types
- 04Partition key configuration guidance
- 05ETag-based optimistic concurrency
Use cases
- 01Model documents for Cosmos DB
- 02Configure partition keys for queries
- 03Test with the Cosmos DB emulator
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ dotnet/ efcore --skill cosmos-providerAfter installing, type/cosmos-providerin Claude Code to confirm it loaded.
Details
From the project READMECosmos DB Provider
Non-relational provider with its own parallel query pipeline. Uses JSON for document materialization.
Key Differences from Relational
- No migrations — use
EnsureCreated() - Documents as JSON — owned and complex types become embedded objects
- Partition key configuration required for performance
ETagfor optimistic concurrency- No cross-container joins
Azure Cosmos DB Emulator for Tests
TestEnvironment.InitializeAsync()auto-starts aTestcontainers.CosmosDbcontainer whenTest__Cosmos__DefaultConnectionis not set. Set the env var to use an existing emulator instead.- Skip tests requiring unsupported features on the Linux emulator with
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))].
Comments
Markdown supported