-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
Description
Is there guidance on how to use EF Core Cosmos provider with Dependency Injection? Does the cosmos DbContext use the singleton pattern?
Of particular interest is around ensuring singleton pattern and the overarching best practice from the Cosmos docs to use a single static client for the lifetime of web apps. My use-case is to use the EF Core Cosmos provider in an Azure Function, and as such, since both Functions and Cosmos docs strongly advise static clients, I am curious how to properly use DI with the Cosmos provider to ensure a single static client.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 738deb7b-d752-f628-3860-fe53891cadb0
- Version Independent ID: e0a18db9-d605-2a78-b77a-d22375dcfd4e
- Content: Azure Cosmos DB Provider - EF Core
- Content Source: entity-framework/core/providers/cosmos/index.md
- Product: entity-framework
- Technology: entity-framework-core
- GitHub Login: @AndriySvyryd
- Microsoft Alias: ansvyryd