Q:

Configuration Settings From database for multi-tenancy. Using Castle Windsor + S#arp

I am converting my application to a multi-tenancy application, one of my obstacles is that now I have to store settings for each tenant in the database.
I am currently using the DictionaryAdapter to read the settings from my app config file into a IConfigurationSettings interface.
Because I can have many tenants, I think my configuration settings need to be registered to castle with different keys, ideally the host name as the key.
However, during the time of castle registration I don't have access to the Request object to get my hostname, also my NHibernate initialisation hasn't taken place.
Anyone got any suggustions?
Paul

A:

If you need to get the settings for each tenant, then can you not do this after the initialisation of NHibernate for the master database and iterate through the tenants?
Also, do the settings actually need to be loaded at startup? Can they be read when required, which will probably be in response to a request.

