Multitenant NHibernate application with with separate SQL Server schema for each tenant
- by Branko
I am writing a new multi-tenant WCF RIA application. I plan to have a shared database with separate SQL Server schema for each tenant. I would like to use NHibernate for object-ralational mapping.
Configuration of SQL Server schema in mapping classes doesn't help because it is static and would need one set of mapping classes for each tenant.
Is it possible to dynamically configure ISession which SQL Server schema should be used for mapping objects to tables?