In my application there can be multiple servers to connect to. Each server can have more repositories, that can be opened in the app. I have a few objects for wrapping the logic of calling webservices on the repository in a concrete server and they are singletons (this is unimportant).
The app will usually handle 0-5 servers which each will have 0-5 repos. The number of objects are 5.
I want to store these objects in a class, but the
Dictionary<string, Dictionary<string, Dictionary<type, IServiceProvider>>>
seems a bit weird… Am I only paranoid or is this really a bad idea?
You can have aggregate keys as long as you define equality and hashcode appropriately (or for simplicity even use a struct instead):
Now you can just use a
Dictionary<ServiceProperties, IServiceProvider>