Thank you so much, I attempted this myself last night but went the
wrong way about it. These seems much more elegant!
1 question though, I have created a custom repository called
ITenantRepository with a function to return all tenants and eager load
some config settings for each config.
But the tenantRepository is trying to use a session factory for one of
my tenants instead of the default...how can i override the factory key
for this repository...I may be overlooking something simple here.
Thank you for your efforts!
Paul
On Jan 12, 12:48 pm, Chris Richards
<
chris.richa...@yellowfeather.co.uk> wrote:
> Hi Paul,
>
> I've forked S#arp Architecture and made some minor changes to allow
> different methods of getting the session factory key.
>
> Basically I've created an interface ISessionFactoryKeyProvider to hide
> the details of getting the session factory key. The default
> implementation I've added, DefaultSessionFactoryKeyProvider, uses the
> existing SessionFactoryAttribute so the only change required to
> existing application is to register DefaultSessionFactoryKeyProvider
> in the container. To use a different method it is just a case of
> providing and registering your own implementation of
> ISessionFactoryKeyProvider.
>
> I've made a pull request (
https://github.com/sharparchitecture/Sharp-
> Architecture/pull/1) so hopefully this will make it into the mainline
> at some point in the future.
>
> These changes simplify adding multi-tenancy to an app. The
> MultiTenenatRepository from my post is no longer required and the
> binder should now work. The custom TransactionAttribute is also no
> longer required. The sample projecthttps://
github.com/yellowfeather/SharpArchitecture-MultiTenant