Injecting tenant repositories with StructureMap in a multi-tenant MVC applicaiton
- by FreshCode
I'm implementing StructureMap in a multi-tenant ASP.NET MVC application to inject instances of my tenant repositories that retrieve data based on an ITenantContext interface. The Tenant in question is determined from RouteData in a base controller's OnActionExecuting.
How do I tell StructureMap to construct TenantContext(tenantID); where tenantID…