diff --git a/docs/en/Startup-Templates/Application.md b/docs/en/Startup-Templates/Application.md index 4dabe6a9da..83950ddd0e 100644 --- a/docs/en/Startup-Templates/Application.md +++ b/docs/en/Startup-Templates/Application.md @@ -266,8 +266,6 @@ Server side is very similar to the solution described above. `.HttpApi.Host` pro The files under the `angular/src/environments` folder has the essential configuration of the application. -#### - ## What's Next? - See [Getting Started With the ASP.NET Core MVC Template](../Getting-Started-AspNetCore-MVC-Template.md) to create a new solution and run it for this template. diff --git a/docs/zh-Hans/CLI.md b/docs/zh-Hans/CLI.md index 57799724bd..ad79e30449 100644 --- a/docs/zh-Hans/CLI.md +++ b/docs/zh-Hans/CLI.md @@ -45,13 +45,13 @@ abp new Acme.BookStore * `ef`: Entity Framework Core. * `mongodb`: MongoDB. * `--tiered`: 创建分层解决方案,Web和Http Api层在物理上是分开的. 如果未指定会创建一个分层的解决方案, 此解决方案没有那么复杂,适合大多数场景. - * `mvc-module`: ASP.NET Core [MVC模块模板](Startup-Templates/Mvc-Module.md). 其他选项: + * `module`: [模块模板](Startup-Templates/Module.md). 其他选项: * `--no-ui`: 不包含UI. 仅创建服务模块 (也称为微服务 - 没有UI). * `--output-folder` 或 `-o`: 指定输出文件夹,默认是当前目录. ### add-package -添加新的ABP包到项目中 +通过以下方式将ABP包添加到项目中 * 添加nuget包做为项目的依赖项目. * 添加 `[DependsOn(...)]` attribute到项目的模块类 (请参阅 [模块开发文档](Module-Development-Basics.md)). @@ -78,7 +78,7 @@ abp add-package Volo.Abp.MongoDB ### add-module -通过查找模块的所有包,查找解决方案中的相关项目,并将每个包添加到解决方案中的相应项目,从而将多包模块添加到解决方案中. +通过查找模块的所有包,查找解决方案中的相关项目,并将每个包添加到解决方案中的相应项目,从而将[多包应用程序模块](Modules/Index)添加到解决方案中. > 由于分层,不同的数据库提供程序选项或其他原因,业务模块通常由多个包组成. 使用`add-module`命令可以大大简化向模块添加模块的过程. 但是每个模块可能需要一些其他配置,这些配置通常在相关模块的文档中指出. @@ -100,6 +100,7 @@ abp add-module Volo.Blogging * `--solution` 或 `-s`: 指定解决方案 (.sln) 路径. 如果未指定,CLI会尝试在当前目录中寻找.sln文件. * `--skip-db-migrations`: 对于EF Core 数据库提供程序,它会自动添加新代码的第一次迁移 (`Add-Migration`) 并且在需要时更新数据库 (`Update-Database`). 指定此选项可跳过此操作. +* `-sp` 或 `--startup-project`: 启动项目的项目文件夹的相对路径. 默认值是当前文件夹. ### update diff --git a/docs/zh-Hans/Getting-Started-AspNetCore-Application.md b/docs/zh-Hans/Getting-Started-AspNetCore-Application.md index 021f82b89f..d6e0e1f570 100644 --- a/docs/zh-Hans/Getting-Started-AspNetCore-Application.md +++ b/docs/zh-Hans/Getting-Started-AspNetCore-Application.md @@ -186,4 +186,4 @@ public class Program ### 源码 -从[此处](../samples/BasicAspNetCoreApplication)获取本教程中创建的示例项目的源代码. +从[此处](https://github.com/abpframework/abp/tree/dev/samples/BasicAspNetCoreApplication)获取本教程中创建的示例项目的源代码. diff --git a/docs/zh-Hans/Getting-Started-AspNetCore-MVC-Template.md b/docs/zh-Hans/Getting-Started-AspNetCore-MVC-Template.md index 7f465dc5bb..36268beb8a 100644 --- a/docs/zh-Hans/Getting-Started-AspNetCore-MVC-Template.md +++ b/docs/zh-Hans/Getting-Started-AspNetCore-MVC-Template.md @@ -35,7 +35,7 @@ abp new Acme.BookStore 该解决方案具有分层结构(基于[Domain Driven Design](Domain-Driven-Design.md)), 并包含配置好的的单元&集成测试项目,可与**EF Core**和**SQLite**数据库内存一起使用. -> 请参阅[MVC应用程序模板文档](Startup-Templates/Mvc.md)以详细了解解决方案结构. +> 请参阅[应用程序模板文档](Startup-Templates/Application.md)以详细了解解决方案结构. ### 数据库连接字符串 diff --git a/docs/zh-Hans/Getting-Started-Console-Application.md b/docs/zh-Hans/Getting-Started-Console-Application.md index 346836c8e3..474323beea 100644 --- a/docs/zh-Hans/Getting-Started-Console-Application.md +++ b/docs/zh-Hans/Getting-Started-Console-Application.md @@ -121,4 +121,4 @@ namespace AbpConsoleDemo ### 源码 -从[这里](../samples/BasicConsoleApplication)获取本教程中创建的示例项目的源代码. \ No newline at end of file +从[这里](https://github.com/abpframework/abp/tree/dev/samples/BasicConsoleApplication)获取本教程中创建的示例项目的源代码. \ No newline at end of file diff --git a/docs/zh-Hans/Startup-Templates/Mvc.md b/docs/zh-Hans/Startup-Templates/Application.md similarity index 87% rename from docs/zh-Hans/Startup-Templates/Mvc.md rename to docs/zh-Hans/Startup-Templates/Application.md index fa28c7d869..2a0263d43a 100644 --- a/docs/zh-Hans/Startup-Templates/Mvc.md +++ b/docs/zh-Hans/Startup-Templates/Application.md @@ -1,10 +1,8 @@ -# MVC应用程序启动模板 +# 应用程序启动模板 ## 介绍 -MVC应用程序启动模板是基于[领域驱动设计](../Domain-Driven-Design.md)(DDD)分层(或根据偏好分层)的应用程序结构. - -在这篇文档中详细介绍了解决方案结构和项目 +应用程序启动模板是基于[领域驱动设计](../Domain-Driven-Design.md)(DDD)分层的应用程序结构. 在这篇文档中详细介绍了解决方案结构和项目,如果你想快速入门,请遵循以下指南: * 参阅[ASP.NET Core MVC 模板入门](../Getting-Started-AspNetCore-MVC-Template.md)创建此模板的新解决方案并运行它. * 参阅[ASP.NET Core MVC 教程](../Tutorials/AspNetCore-Mvc/Part-I.md)学习使用此模板开发应用程序. @@ -22,11 +20,24 @@ dotnet tool install -g Volo.Abp.Cli 然后使用 `abp new` 命令在空文件夹中创建新解决方案: ````bash -abp new Acme.BookStore -t mvc +abp new Acme.BookStore -t app ```` * `Acme.BookStore` 是解决方案的名称, 如*YourCompany.YourProduct*. 你可以使用单级或多级名称. -* 示例中指定了启动模板 (`-t` 或 `--template` 选项). 不过 `mvc` 是默认模板,即使未指定也会创建 `MVC` 的模板项目. +* 示例中指定了启动模板 (`-t` 或 `--template` 选项). 示指定模板时,默认模板是`app` . + +### 指定UI框架 + +模板提供了多个UI框架 + +* `mvc`: ASP.NET Core MVC Razor页面 (默认) +* `angular`: Angular UI + +使用 `-u` 或 `--ui` 选择指定UI框架: + +````bash +abp new Acme.BookStore -u angular +```` ### 指定数据库提供程序 @@ -41,23 +52,13 @@ abp new Acme.BookStore -t mvc abp new Acme.BookStore -d mongodb ```` -### 创建分层解决方案 - -使用 `--tiered` 选项创建分层解决方案, Web与WebApi层在物理上是分开的. 如果未指定,CLI会创建一个分层的解决方案,这个解决方案没有那么复杂,适合大多数场景. - -````bash -abp new Acme.BookStore --tiered -```` - -有关分层的方法,请参阅下面的"分层结构"部分. - ## 解决方案结构 根据命令的选项,会创建略有不同的解决方案结构. ### 默认结构 -如果未指定选项,你会得到如下所示的解决方案: +如果未指定附加选项,你会得到如下所示的解决方案: ![bookstore-visual-studio-solution-v3](../images/bookstore-visual-studio-solution-v3.png) @@ -159,7 +160,7 @@ ABP有[动态 C# API 客户端](../AspNetCore/Dynamic-CSharp-API-Clients.md)功 #### .Web 项目 -包含应用程序的用户界面(UI). 包括Razor页面,javascript文件,样式文件,图片等... +包含应用程序的用户界面(UI).如果使用ASP.NET Core MVC UI, 它包括Razor页面,javascript文件,样式文件,图片等... 包含应用程序主要的 `appsettings.json` 配置文件,用于配置数据库连接字符串和应用程序的其他配置 @@ -180,10 +181,10 @@ ABP有[动态 C# API 客户端](../AspNetCore/Dynamic-CSharp-API-Clients.md)功 * `.Domain.Tests` 用于测试领域层. * `.Application.Tests` 用于测试应用层. * `.EntityFrameworkCore.Tests` 用于测试EF Core配置与自定义仓储. -* `.Web.Tests` 用于测试UI. +* `.Web.Tests` 用于测试UI(适用于ASP.NET Core MVC UI). * `.TestBase` 所有测试项目的基础(共享)项目. -此外, `.HttpApi.Client.ConsoleTestApp` 是一个控制台应用程序(不是自动化测试项目),它用于演示DotNet应用程序中HTTP API的用法. +此外, `.HttpApi.Client.ConsoleTestApp` 是一个控制台应用程序(不是自动化测试项目),它用于演示.Net应用程序中HTTP API的用法. 测试项目是用于做集成测试的: @@ -201,7 +202,7 @@ ABP有[动态 C# API 客户端](../AspNetCore/Dynamic-CSharp-API-Clients.md)功 ### 分层结构 -如果你按上面的描述指定了 `--tiered` 选项,会创建分层解决方案. 分层结构的目的是**将Web应用程序和HTTP API部署到不同的服务器**: +如果你选择了ASP.NET Core UI并指定了 `--tiered` 选项,CLI会创建分层解决方案. 分层结构的目的是**将Web应用程序和HTTP API部署到不同的服务器**: ![tiered-solution-servers](../images/tiered-solution-servers.png) @@ -252,6 +253,17 @@ ABP使用开源的[IdentityServer4](https://identityserver.io/)框架做应用 * 然后运行`.HttpApi.Host`,因为`.Web`应用程序需要访问HTTI API. * 最后运行`.Web`并登录到应用程序(用户名: `admin` 密码: `1q2w3E*`). +### Angular UI + +如果你选择Angular做为UI框架(使用 `-u angular` 选择), 解决方案会被分成两个文件夹: + +* `angular` 是客户端部分,文件夹中包含了Angular UI 解决方案. +* `aspnet-core` 是服务端部分,文件夹中包含了ASP.NET Core解决方案. + +服务端部分与上面的描述的解决方案非常相似. `.HttpApi.Host` 项目提供API接口, Angular应用程序使用它提供的接口. + +`angular/src/environments` 文件夹下的文件含有应用程序的基础配置. + ## 下一步是什么? * 参阅[ASP.NET Core MVC 模板入门](../Getting-Started-AspNetCore-MVC-Template.md)创建此模板的新解决方案并运行它. diff --git a/docs/zh-Hans/Startup-Templates/Index.md b/docs/zh-Hans/Startup-Templates/Index.md index c4c75bbedb..57389e6df0 100644 --- a/docs/zh-Hans/Startup-Templates/Index.md +++ b/docs/zh-Hans/Startup-Templates/Index.md @@ -4,5 +4,5 @@ 单击下面列表中的名称以查看相关启动模板的文档: -* [**mvc**](Mvc.md): ASP.NET Core MVC应用程序模板. -* [**mvc-module**](Mvc-Module.md): ASP.NET Core MVC模块/服务模板. \ No newline at end of file +* [**app**](Application.md): 应用程序模板. +* [**module**](Module.md): 模块/服务模板. \ No newline at end of file diff --git a/docs/zh-Hans/Startup-Templates/Mvc-Module.md b/docs/zh-Hans/Startup-Templates/Module.md similarity index 98% rename from docs/zh-Hans/Startup-Templates/Mvc-Module.md rename to docs/zh-Hans/Startup-Templates/Module.md index b45bce010e..adc368ed89 100644 --- a/docs/zh-Hans/Startup-Templates/Mvc-Module.md +++ b/docs/zh-Hans/Startup-Templates/Module.md @@ -15,14 +15,14 @@ dotnet tool install -g Volo.Abp.Cli 然后使用 `abp new` 命令在空文件夹中创建新解决方案: ````bash -abp new Acme.IssueManagement -t mvc-module +abp new Acme.IssueManagement -t module ```` * `Acme.IssueManagement` 是解决方案的名称, 如*YourCompany.YourProduct*. 你可以使用单级或多级名称. ### 无用户界面 -默认情况模板附带一个UI,你可以使用`--no-ui`选项指定不包含UI层. +默认情况模板附带一个MVC UI,你可以使用`--no-ui`选项指定不包含UI层. ````bash abp new Acme.IssueManagement -t mvc-module --no-ui diff --git a/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-I.md b/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-I.md index f58df60e27..c9a56447ba 100644 --- a/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-I.md +++ b/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-I.md @@ -10,7 +10,9 @@ - [Part II: 创建,编辑,删除书籍](Part-II.md) - [Part III: 集成测试](Part-III.md) -你可以从[GitHub存储库](https://github.com/volosoft/abp/tree/master/samples/BookStore)访问应用程序的**源代码**. +你可以从[GitHub存储库](https://github.com/abpframework/abp/tree/master/samples/BookStore)访问应用程序的**源代码**. + +> 你也可以观看由ABP社区成员为本教程录制的[视频课程](https://amazingsolutions.teachable.com/p/lets-build-the-bookstore-application). ### 创建项目 @@ -22,7 +24,7 @@ ![bookstore-visual-studio-solution](images/bookstore-visual-studio-solution-v3.png) -> 你可以查看[MVC应用程序模板文档](../../Startup-Templates/Mvc.md)以详细了解解决方案结构.但是,你将通过本教程了解基础知识. +> 你可以查看[应用程序模板文档](../../Startup-Templates/Application.md)以详细了解解决方案结构.但是,你将通过本教程了解基础知识. ### 创建Book实体 @@ -99,7 +101,7 @@ public class BookStoreDbContext : AbpDbContext builder.Entity(b => { b.ToTable(BookStoreConsts.DbTablePrefix + "Books", BookStoreConsts.DbSchema); - b.ConfigureAuditedAggregateRoot(); //auto configure for the base class props + b.ConfigureByConvention(); //auto configure for the base class props b.Property(x => x.Name).IsRequired().HasMaxLength(128); }); ```` @@ -457,7 +459,7 @@ $(function () { 最终的页面如下: -![bookstore-book-list](images/bookstore-book-list.png) +![bookstore-book-list](images/bookstore-book-list-2.png) ### 下一章 diff --git a/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-II.md b/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-II.md index fabe3fd4d5..dd86b5e119 100644 --- a/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-II.md +++ b/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-II.md @@ -10,11 +10,13 @@ 你可以从[GitHub存储库](https://github.com/volosoft/abp/tree/master/samples/BookStore)访问应用程序的**源代码**. +> 你也可以观看由ABP社区成员为本教程录制的[视频课程](https://amazingsolutions.teachable.com/p/lets-build-the-bookstore-application). + ### 新增 Book 实体 通过本节, 你将会了解如何创建一个 modal form 来实现新增书籍的功能. 最终成果如下图所示: -![bookstore-create-dialog](images/bookstore-create-dialog.png) +![bookstore-create-dialog](images/bookstore-create-dialog-2.png) #### 新建 modal form diff --git a/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-III.md b/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-III.md index c31f750832..5bbe0e3424 100644 --- a/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-III.md +++ b/docs/zh-Hans/Tutorials/AspNetCore-Mvc/Part-III.md @@ -10,6 +10,8 @@ 你可以从[GitHub存储库](https://github.com/volosoft/abp/tree/master/samples/BookStore)访问应用程序的**源代码**. +> 你也可以观看由ABP社区成员为本教程录制的[视频课程](https://amazingsolutions.teachable.com/p/lets-build-the-bookstore-application). + ### 解决方案中的测试项目 解决方案中有多个测试项目: diff --git a/docs/zh-Hans/images/bookstore-swagger-ui-host.png b/docs/zh-Hans/images/bookstore-swagger-ui-host.png new file mode 100644 index 0000000000..74ff73f7e3 Binary files /dev/null and b/docs/zh-Hans/images/bookstore-swagger-ui-host.png differ diff --git a/docs/zh-Hans/images/bookstore-visual-studio-solution-for-spa.png b/docs/zh-Hans/images/bookstore-visual-studio-solution-for-spa.png new file mode 100644 index 0000000000..5a5a283c7d Binary files /dev/null and b/docs/zh-Hans/images/bookstore-visual-studio-solution-for-spa.png differ