Resolve dependencies in the MultiTenantConnectionBuilder method

If I understand your initial code snippet correctly, the IClientConnectionService is registered once and then decides what connection string to return based on the “tenant id” provided to the IClientConnectionService.Get(string tenantId) method.

If my understanding is correct, what’s the problem with registering the IClientConnectionService implementation in the container, considering that the connection string resolution logic is inside the Get method?

I might be missing something obvious, in which case, forgive me.