Orchard Core 文档翻译 (三) Orchard Core Modules

原文链接:http://www.javashuo.com/article/p-ennntqlt-er.html html

转载请注明出处web

 

介绍

Orchard Core Modules库提供了一种机制,能够拥有一个独立的模块化系统,您能够选择加入特定的应用程序框架,而没必要依赖于您的应用程序设计。 app

 

原文[[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 安装到项目中async

接下来,在Startup.cs中,将方法ConfigureServices修改成以下所示:
 // Add ASP.NET MVC and support for modules            
 services.AddOrchardCore()
         .AddMvc();

  

Noteide

注意添加 .AddMvc()模块化

Asp.Net Mvc如今是您管道的一部分.spa

您能够在此处找到示例应用程序: 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

 

 

原文链接:http://www.javashuo.com/article/p-ennntqlt-er.html 

转载请注明出处

相关文章
相关标签/搜索