Skip to content

Add UseCosmosDbPersistence overload for DI-registered CosmosClient#1421

Open
mbadev62 wants to merge 2 commits intodanielgerlag:masterfrom
mbadev62:feature/cosmosdb-di-client-overload
Open

Add UseCosmosDbPersistence overload for DI-registered CosmosClient#1421
mbadev62 wants to merge 2 commits intodanielgerlag:masterfrom
mbadev62:feature/cosmosdb-di-client-overload

Conversation

@mbadev62
Copy link
Copy Markdown

@mbadev62 mbadev62 commented Mar 27, 2026

Summary

  • Adds a new UseCosmosDbPersistence overload that resolves CosmosClient from the DI container
  • Allows applications that already register CosmosClient in their service collection to configure CosmosDB persistence without duplicating client setup
  • Consistent with existing overload patterns in ServiceCollectionExtensions

Resolves: #1424

Test plan

  • Build solution verified with no compilation errors
  • New overload tested and working correctly

🤖 Generated with Claude Code

Adds a new overload of UseCosmosDbPersistence that resolves CosmosClient
from the DI container instead of requiring a connection string or
TokenCredential. This allows applications that already register CosmosClient
in their service collection to wire up CosmosDB persistence without
duplicating client configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UseCosmosDbPersistence() should support factory delegate to resolve CosmosClient from DI container

1 participant