With having the tenent identified, we now need to build a connection for the tenant to connect to their database.
In our case, we chose NHibernate for our OR/M solution. If you are using Entity Framework, Linq to SQL, etc., Adjust the code to build your connection to your object retrieval/storage medium of choice and continue on.
The basic logic here is to utilize the client token, and determine if a connection definition is already created or not. In the event that it has been created, we simply retrieve the configured connection definition and return it to the caller. If it is not yet created, we build the connection definition, store it within the collection, then return it to the caller.