Handling Multi Tenancy on MVC
I would like to ask your opinions regarding the way I handle MultiTenancy. I"m using MVC3 (switching to MVC4) and EF as my backend. I'm using a single app, shared schema MultiTenancy. Below is the code: public abstract class Service<T> where T : Entity { private Repository<T> _repo; public Service() { _repo = new Repository<T>(); } public bool Authenticate(int id) { //var companyInfo = _authorizationRepository.GetApiKey(apiKey); int tenantId = 0; // replaced by companyInfo using repository var entity = _repo.GetQuery(tenantId).Where(e => e.Id == id).First(); if (tenantId != entity.TenantId)