Multitenancy Techniques for the UI in ASP.NET Core
Introduction I've been writing some posts on multitenancy with ASP.NET Core. So far we have: Tenant identification Data filtering (for EF Core) UI customisation (this article) Business logic This time I'm going to talk about the User Interface (UI) and give some suggestions for: Loading contents inside of a view conditionally per tenant Loading different views for different tenants Using code for making tenant-dependent choices We shall be referencing the same ITenantIdProvider abstraction shown before. All the views I'll be talking about are, of course, Razor views , which can be views in a MVC app or Razor Pages . Loading Different Views per Tenant Views are used to render HTML contents in a MVC project. The actual service that is responsible for locating the views files is IViewLocationExpander . We will implement our own version that sticks another path to the list of paths used to search for views (the original ones come from RazorViewEngineOption...