Orchard Harvest 2017–What is Orchard Core SaaS Framework?
Nick Mayne is one of the main developers working on Orchard 2.0, a.k.a. Orchard Core.
Orchard Core started as an MVC application, but this had several challenges with multi-tenancy and Glimpse integration. To solve those problems, Nick moved things around so MVC actually is a module instead. I found that really interesting as I had implemented something really similar when I built DecentCMS: Express is loaded as a module, for each tenant.
In his first demo, he started with a simple ASP.NET Core application, and transformed it into an Orchard Core application where the application code lives in a module instead of the startup class where it began. In the module, a simple class derives from StartupBase and overrides Configure and ConfigureServices.
The second demo is improving on the first one by adding actual MVC to the application. The existing module is modified to register MVC. Nick then added a new module, gave it a controller with an Index action. The result is MVC in an Orchard Core site with a module registering MVC, and another using MVC. In a full Orchard stack, the module registering MVC would be “the MVC module”, and the other would just take a dependency on it.
Next, Nick showed how to point the site’s host to an alternate module location. This is how themes are added: services.AddExtensionLocation(“Themes”). You can also modify manifest definitions.
For the moment, we haven’t created any tenants. In other words, everything has been running on the default tenant. Using services.AddSitesfolder(“App_data”, “Sites”), it’s possible to point the application to locations where tenants are defined. Nick created two sites with their own manifests, which creates two tenants with all features enabled. To differentiate them, he injected the ShellSettings into the controller, whose action can now output properties coming from each tenant manifest.
Finally, Nick showed how to swap MVC for Nancy. Yes, one interesting consequence of having MVC as a module is that you may not use it at all, and you may even use something else altogether, such as Nancy. Moreover, you may even have one module built on Nancy, and another on MVC, all running in the same host. This is really very cool and shows just how low footprint Orchard Core is, and how its services, such as multi-tenancy and modules, come at a very low price and impose very few constraints on the whole system. In other words, you get exactly what you want, and nothing more.