OpenParable
Skip to content
← Back to skills

Cosmos Provider

Development
cosmos-provider

Cosmos Provider is an Agent Skill for development published in the dotnet/efcore repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Implementation details for the EF Core Azure Cosmos DB provider. Use when changing Cosmos-specific code.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/dotnet/efcore/blob/HEAD/.agents/skills/cosmos-provider/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/cosmos-provider, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Cosmos 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
  • ETag for optimistic concurrency
  • No cross-container joins

Azure Cosmos DB Emulator for Tests

  • TestEnvironment.InitializeAsync() auto-starts a Testcontainers.CosmosDb container when Test__Cosmos__DefaultConnection is 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))].