-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access to CosmosClient creation #398
Comments
Hi @joelsteventurner - thank you for your kind words, and ideas here. I know that others have specifically asked for multitenancy support, that would be awesome to add! As for the idea around exposing the I love contributions, and I'm happy to work with you on making those a reality. What do you think? |
Hi @IEvangelist , that sounds great. I'll submit a pull request for changing the interface accessibility from internal to public. |
@IEvangelist submitted the pull request. |
Closing this as #403 fixed it |
…ch tenant connects to their own specific Cosmos DB Along with the previous change I did to make ICosmosClientProvider public (IEvangelist#398) * made ICosmosContainerProvider public The Default implementation caches containers, I needed a custom implementation to cache these per Tenant * Repository option - I made DatanaseId, ContainerId and connection string virtual Again in my implementation I need these to be tenant specific, making these virtual allows me over replace this with a MultiTenant version on RepositoryOptions
…ch tenant connects to their own specific Cosmos DB (#428) Along with the previous change I did to make ICosmosClientProvider public (#398) * made ICosmosContainerProvider public The Default implementation caches containers, I needed a custom implementation to cache these per Tenant * Repository option - I made DatanaseId, ContainerId and connection string virtual Again in my implementation I need these to be tenant specific, making these virtual allows me over replace this with a MultiTenant version on RepositoryOptions
I've been using this framework and am generally very happy with it, but I have run into a couple scenarios where the framework makes it difficult to do certain things. These issues all seem to stem from the fact that the CosmosClient instantiation is inaccessible.
The 2 scenarios that are proving problematic to me are as follows:
In this scenario I'd ideally want a cached
CosmosClient
per tenant, but the framework has a singletonCosmosClient
and the factory interface for thisICosmosClientProvider
is internal so I see no way to easily extend this.Here I am using
Microsoft.AspNetCore.Mvc.Testing
along withTestcontainers.CosmosDb
to write automated integration tests. In this scenario I need to as part of the tests reconfigure my application, see example below. Here you can see the need forCosmosClient
re-configuration / customization.The feature I'd like to simply making the
ICosmosClientProvider
interface public so that custom implementations can be supplied.Or more generally make it such that there is a factory which creates the
CosmosClient
, which can have its implementation swapped out.This would allow me to create a
MultiTenantCosmosClientProvider
and anIntegrationCosmosClientProvider
which I beleive would solve these issues.The text was updated successfully, but these errors were encountered: