I’ve been using S#arp Architecture (and the Who Can Help Me structure) on a few projects for a while now and on the whole I’m very happy with it. However, Ayende’s recent post Architecting in the pit of doom: The evils of the repository abstraction layer hit a nerve, and got me thinking that maybe I’ve been applying the services (or tasks) / repository abstraction a bit too liberally. The following day I saw this tweet mentioning @fabiomaulo’s Enhanced Query Object which looks just the ticket to solving this issue. So, I’ve updated my SharpArchitecture-MultiTenant project on GitHub to use enhanced query objects.
Following my previous post some issues were pointed out with the implementation, the main one being that the correct repository implementation was not resolved from an IRepository<T> interface (see the Google Group discussion for more details).
Update: the code below is out of date, please see Multi-tenancy on S#arp Architecture Revisited for a better solution