Orchard Core 文檔翻譯 (三) Orchard Core Modules

來源:互聯網
上載者:User

標籤:自動探索   frame   tom   targe   ida   config   wrapper   ext   tps   

原文串連:https://www.cnblogs.com/Qbit/p/andorid-netcore.html

轉載請註明出處

 介紹

Orchard Core Modules庫提供了一種機制,可以擁有一個獨立的模組化系統,您可以選擇加入特定的應用程式架構,而不必依賴於您的應用程式設計。 

 

原文[[The library Orchard Core Modules provides a mechanism to have a self-contained modular system where you can opt in to a specific application framework and not have the design of your application be dictated to by such.
]]...

 

 

快速入門

 

在Visual Studio中,建立一個新的Web應用程式。通過管理項目NuGet包將OrchardCore.Application.Cms.Targets安裝到項目中。接下來,在Startup.cs中,修改ConfigureServices方法,添加以下行:

 

 

services.AddOrchardCms(); 

 

 

接下來,在Configure方法的末尾,用這一行: app.UseOrchardCore();替換此塊: app.Run(async(context)=>{    await context.Response.WriteAsync(“Hello World!”);});  

 

其他架構您可以輕鬆地將喜愛的應用程式架構添加到管道中。以下實現旨在並行工作,因此如果您想在管道中使用Asp.Net Mvc和Nancy,只需添加兩者即可。

下面的模組化架構套件裝器被設計為直接與模組化應用程式架構一起工作,因此避免添加原始架構並期望它可以工作。 

 

原文[[The modular framework wrappers below are designed to work directly with the modular application framework, so avoid just adding the raw framework and expect it to just work.]]...Asp.Net Mvc

通過NuGet包管理器將OrchardCore.Application.Mvc.Targets 安裝到項目中

接下來,在Startup.cs中,將方法ConfigureServices修改為如下所示:
 // Add ASP.NET MVC and support for modules             services.AddOrchardCore()         .AddMvc();

  

Note

注意添加 .AddMvc()

Asp.Net Mvc現在是您管道的一部分.

您可以在此處找到應用程式範例: OrchardCore.Mvc.Web

NancyFx

通過管理項目NuGet包將OrchardCore.Application.Nancy.Targets安裝到項目中

接下來,在Startup.cs中,將方法ConfigureServices修改為如下所示:

 // Add Nancy and support for modules            services                .AddOrchardCore()                .AddNancy()                ;

 

 

Note

注意添加 .AddNancy()

NancyFx 現在是您管道的一部分。這意味著Nancy模組將被自動探索。

您可以在這裡找到一個應用程式範例: OrchardCore.Nancy.Web

 

 

原文串連:https://www.cnblogs.com/Qbit/p/andorid-netcore.html

轉載請註明出處

Orchard Core 文檔翻譯 (三) Orchard Core Modules

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.