Orchard Core Framework:ASP.NET Core Modular, multi-tenant framework
The previous authoring Orchard Core builds an ASP. NET core CMS, introducing the ASP. NET core CMS, orchard ASP, with an ASP. NET Core framework.
Support for modularity and multi-tenancy. The entire orchard Core is made up of modules module
First create an empty ASP. NET Core Web application as a base. The following module to learn the establishment and use.
Modular
First, in the previously created ASP. NET Core Web application, create a new class library (. NET core) project as Moduleweb.
Then add MICROSOFT.ASPNETCORE.MVC and OrchardCore.Module.Targets references.
The command is as follows:
Install-package MICROSOFT.ASPNETCORE.MVC
Install-package Orchardcore.module.targets-pre
Then we can add a view folder and Controllers folder, as well as add a homecontroller and corresponding views page.
Because there are no good new shortcuts on the class library, we recommend that you copy them from the ASP. NET Core Web project.
Public class Homecontroller:controller { public iactionresult Index () { return View (); } }
Home/index.cshtml
from Moduleweb/home/index
The Module is created and then referenced in the ASP. NET Core Web project.
You first need to add a OrchardCore.Application.Mvc.Targets package to your Web project
Install-package Orchardcore.application.mvc.targets-pre
The Moduleweb project is then referenced.
Change Startup.cs as follows:
Public class Startup { publicvoid configureservices (iservicecollection services) { services. Addmodules (); } Public void Configure (Iapplicationbuilder app, ihostingenvironment env) { if (env. Isdevelopment ()) { app. Usedeveloperexceptionpage (); } App. Usemodules (); } }
Note the references in the project are Microsoft.aspnetcore and Microsoft.ApplicationInsights.AspNetCore, which are configured as follows
<ItemGroup> <packagereference include="Microsoft.ApplicationInsights.AspNetCore"version="2.0.0"/> <packagereference include="Microsoft.aspnetcore"version="2.0.0"/> <packagereference include="OrchardCore.Application.Mvc.Targets"version="1.0.0-beta1-3667"/> </ItemGroup> <ItemGroup> <projectreference include=".. \moduleweb\moduleweb.csproj"/> </ItemGroup>
Then run the program, enter Moduleweb/home/index as follows
Multi-tenancyOrchard Core Framework:ASP.NET Core Modular, multi-tenant framework