From a8a944a15138462f04e083f32d40a5adae65960f Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Sat, 30 May 2020 23:30:47 +0800 Subject: [PATCH] Update document --- docs/en/Entity-Framework-Core-Oracle.md | 2 +- docs/zh-Hans/CLI.md | 31 ++++++++ docs/zh-Hans/Entity-Framework-Core-MySQL.md | 17 ----- docs/zh-Hans/Entity-Framework-Core-Oracle.md | 73 +++++++++++++++++++ .../Entity-Framework-Core-Other-DBMS.md | 1 + docs/zh-Hans/Getting-Started.md | 2 +- docs/zh-Hans/UI/Angular/Localization.md | 62 ++++++++++++++++ docs/zh-Hans/docs-nav.json | 4 + 8 files changed, 173 insertions(+), 19 deletions(-) create mode 100644 docs/zh-Hans/Entity-Framework-Core-Oracle.md diff --git a/docs/en/Entity-Framework-Core-Oracle.md b/docs/en/Entity-Framework-Core-Oracle.md index c6b520bde7..3c74cb6d8c 100644 --- a/docs/en/Entity-Framework-Core-Oracle.md +++ b/docs/en/Entity-Framework-Core-Oracle.md @@ -40,7 +40,7 @@ var builder = (DbContextOptionsBuilder) ## Change the Connection Strings -Oracle connection strings are different than SQL Server connection strings. So, check all `appsettings.json` files in your solution and replace the connection strings inside them. See the [connectionstrings.com]( https://www.connectionstrings.com/mysql/ ) for details of Oracle connection string options. +Oracle connection strings are different than SQL Server connection strings. So, check all `appsettings.json` files in your solution and replace the connection strings inside them. See the [connectionstrings.com]( https://www.connectionstrings.com/oracle/ ) for details of Oracle connection string options. You typically will change the `appsettings.json` inside the `.DbMigrator` and `.Web` projects, but it depends on your solution structure. diff --git a/docs/zh-Hans/CLI.md b/docs/zh-Hans/CLI.md index 658545c4fd..c0147aa3a8 100644 --- a/docs/zh-Hans/CLI.md +++ b/docs/zh-Hans/CLI.md @@ -18,6 +18,37 @@ dotnet tool update -g Volo.Abp.Cli ## Commands +这里是所有可用的命令列表: + +* **`help`**: 展示ABP CLI的用法帮助信息. +* **`new`**:生成基于ABP的[启动模板](Startup-Templates/Index.md). +* **`update`**:自动更新的ABP解决方案ABP相关的NuGet和NPM包. +* **`add-package`**: 添加ABP包到项目. +* **`add-module`**: 添加[应用模块](https://docs.abp.io/en/abp/latest/Modules/Index)到解决方案. +* **`generate-proxy`**: 生成客户端代理以使用服务器上的HTTP API端点. +* **`switch-to-preview`**: 切换解决方案所有ABP相关包为[夜间构建](Nightly-Builds.md)版本. +* **`switch-to-stable`**: 切换解决方案所有ABP相关包为最新的稳定版本. +* **`translate`**: 当源代码控制存储库中有多个JSON[本地化](Localization.md文件时,可简化翻译本地化文件的过程. +* **`login`**: 使用你在[abp.io](https://abp.io/)的用户名和密码在你的计算机上认证. +* **`logout`**: 在你的计算机注销认证. + +### help + +展示ABP CLI的基本用法: + +用法: + +````bash +abp help [command-name] +```` + +示例: + +````bash +abp help # Shows a general help. +abp help new # Shows help about the "new" command. +```` + ### new 生成基于ABP[启动模板](Startup-Templates/Index.md)的新解决方案. diff --git a/docs/zh-Hans/Entity-Framework-Core-MySQL.md b/docs/zh-Hans/Entity-Framework-Core-MySQL.md index 15e2205c38..48297ea68d 100644 --- a/docs/zh-Hans/Entity-Framework-Core-MySQL.md +++ b/docs/zh-Hans/Entity-Framework-Core-MySQL.md @@ -25,23 +25,6 @@ MySQL连接字符串与SQL Server连接字符串不同. 所以检查你的解决 通常需要更改 `.DbMigrator` 和 `.Web` 项目里面的 `appsettings.json` ,但它取决于你的解决方案结构. -## 更改迁移DbContext - -MySQL DBMS与SQL Server有一些细微的差异. 某些模块数据库映射配置(尤其是字段长度)会导致MySQL出现问题. 例如某些[IdentityServer模块](Modules/IdentityServer.md)表就存在这样的问题,它提供了一个选项可以根据你的DBMS配置字段. - -启动模板包含*YourProjectName*MigrationsDbContext,它负责维护和迁移数据库架构. 此DbContext基本上调用依赖模块的扩展方法来配置其数据库表. - -打开 *YourProjectName*MigrationsDbContext 更改 `builder.ConfigureIdentityServer();` 行,如下所示: - -````csharp -builder.ConfigureIdentityServer(options => -{ - options.DatabaseProvider = EfCoreDatabaseProvider.MySql; -}); -```` - -然后 `ConfigureIdentityServer()` 方法会将字段长度设置为不超过MySQL的限制. 如果在创建或执行数据库迁移时遇到任何问题请参考相关的模块文档. - ## 重新生成迁移 启动模板使用[Entity Framework Core的Code First迁移](https://docs.microsoft.com/zh-cn/ef/core/managing-schemas/migrations/). EF Core迁移取决于所选的DBMS提供程序. 因此更改DBMS提供程序会导致迁移失败. diff --git a/docs/zh-Hans/Entity-Framework-Core-Oracle.md b/docs/zh-Hans/Entity-Framework-Core-Oracle.md new file mode 100644 index 0000000000..5156331f40 --- /dev/null +++ b/docs/zh-Hans/Entity-Framework-Core-Oracle.md @@ -0,0 +1,73 @@ +# 切换到EF Core Oracle提供程序 + +本文介绍如何将预配置为SqlServer提供程序的 **[应用程序启动模板](Startup-Templates/Application.md)** 切换到 **Oracle** 数据库提供程序 + +> 本文档使用[Devart](https://www.devart.com/dotconnect/oracle/)公司的付费库,因为它是oracle唯一支持EF Core 3.x的库 + +## 替换Volo.Abp.EntityFrameworkCore.SqlServer包 + +解决方案中的 `.EntityFrameworkCore` 项目依赖于 [Volo.Abp.EntityFrameworkCore.SqlServer](https://www.nuget.org/packages/Volo.Abp.EntityFrameworkCore.SqlServer) NuGet包. 删除这个包并且添加相同版本的 [Volo.Abp.EntityFrameworkCore.Oracle.Devart](https://www.nuget.org/packages/Volo.Abp.EntityFrameworkCore.Oracle.Devart) 包. + +## 替换模块依赖项 + +在 `.EntityFrameworkCore` 项目中找到 **YourProjectName*EntityFrameworkCoreModule** 类, 删除 `DependsOn` attribute 上的`typeof(AbpEntityFrameworkCoreSqlServerModule)`, 添加 `typeof(AbpEntityFrameworkCoreOracleDevartModule)` (或者替换 `using Volo.Abp.EntityFrameworkCore.SqlServer;` 为 `using Volo.Abp.EntityFrameworkCore.Oracle.Devart;`). + +## UseOracle() + +Find `UseSqlServer()` calls in your solution, replace with `UseOracle()`. Check the following files: + +* *YourProjectName*EntityFrameworkCoreModule.cs inside the `.EntityFrameworkCore` project. +* *YourProjectName*MigrationsDbContextFactory.cs inside the `.EntityFrameworkCore.DbMigrations` project. + +In the `CreateDbContext()` method of the *YourProjectName*MigrationsDbContextFactory.cs, replace the following code block + +查找你的解决方案中 `UseSqlServer()`调用,替换为 `UseOracle()`. 检查下列文件: + +* `.EntityFrameworkCore` 项目中的*YourProjectName*EntityFrameworkCoreModule.cs. +* `.EntityFrameworkCore` 项目中的*YourProjectName*MigrationsDbContextFactory.cs. + +使用以下代码替换*YourProjectName*MigrationsDbContextFactory.cs中的 `CreateDbContext()` 方法: + +``` +var builder = new DbContextOptionsBuilder() + .UseSqlServer(configuration.GetConnectionString("Default")); +``` + +与这个 + +``` +var builder = (DbContextOptionsBuilder) + new DbContextOptionsBuilder().UseOracle + ( + configuration.GetConnectionString("Default") + ); +``` + +> 根据你的解决方案的结构,你可能发现更多需要改变代码的文件. + +## 更改连接字符串 + +Oracle连接字符串与SQL Server连接字符串不同. 所以检查你的解决方案中所有的 `appsettings.json` 文件,更改其中的连接字符串. 有关oracle连接字符串选项的详细内容请参见[connectionstrings.com](https://www.connectionstrings.com/oracle/). + +通常需要更改 `.DbMigrator` 和 `.Web` 项目里面的 `appsettings.json` ,但它取决于你的解决方案结构. + +Oracle连接字符串示例: + +``` +Data Source=localhost;User Id=myuser;Password=mypassword; +``` + +## 重新生成迁移 + +启动模板使用[Entity Framework Core的Code First迁移](https://docs.microsoft.com/zh-cn/ef/core/managing-schemas/migrations/). EF Core迁移取决于所选的DBMS提供程序. 因此更改DBMS提供程序会导致迁移失败. + +* 删除 `.EntityFrameworkCore.DbMigrations` 项目下的Migrations文件夹,并重新生成解决方案. +* 在包管理控制台中运行 `Add-Migration "Initial"`(在解决方案资源管理器选择 `.DbMigrator` (或 `.Web`) 做为启动项目并且选择 `.EntityFrameworkCore.DbMigrations` 做为默认项目). + +这将创建一个配置所有数据库对象(表)的数据库迁移. + +运行 `.DbMigrator` 项目创建数据库和初始种子数据. + +## 运行应用程序 + +它已准备就绪, 只需要运行该应用程序与享受编码. \ No newline at end of file diff --git a/docs/zh-Hans/Entity-Framework-Core-Other-DBMS.md b/docs/zh-Hans/Entity-Framework-Core-Other-DBMS.md index ca70d8b5c6..fb8ad15787 100644 --- a/docs/zh-Hans/Entity-Framework-Core-Other-DBMS.md +++ b/docs/zh-Hans/Entity-Framework-Core-Other-DBMS.md @@ -6,6 +6,7 @@ ABP框架为一些常见的DMBS提供了简化配置的**集成包**,你可以 * [MySQL](Entity-Framework-Core-MySQL.md) * [PostgreSQL](Entity-Framework-Core-PostgreSQL.md) +* [Oracle](Entity-Framework-Core-Oracle.md) * [SQLite](Entity-Framework-Core-SQLite.md) 你也可以不使用集成包配置DBMS提供程序,虽然总是建议使用集成包(它也使不同模块之间的依赖版本成为标准版本),但是如果没有用于DBMS提供程序的集成包,也可以手动集成. diff --git a/docs/zh-Hans/Getting-Started.md b/docs/zh-Hans/Getting-Started.md index 1b156b070d..adf9517eec 100644 --- a/docs/zh-Hans/Getting-Started.md +++ b/docs/zh-Hans/Getting-Started.md @@ -403,7 +403,7 @@ yarn start 在上面的管理界面中,可以通过使用[Expo Client](https://expo.io/tools#client)扫描二维码,使用Android模拟器,iOS模拟器或真机来启动应用程序. -> 请参阅[expo.io](https://docs.expo.io/versions/v36.0.0/workflow/ios-simulator/)上的[Android Studio模拟器](https://docs.expo.io/versions/v36.0.0/workflow/android-studio-emulator/)和[iOS模拟器文档](https://docs.expo.io/versions/v36.0.0/workflow/android-studio-emulator/). +> 请参阅expo.io上的[Android Studio模拟器](https://docs.expo.io/workflow/android-simulator/)和[iOS模拟器文档](https://docs.expo.io/workflow/ios-simulator/). ![React Native login screen on iPhone 11](images/rn-login-iphone.png) diff --git a/docs/zh-Hans/UI/Angular/Localization.md b/docs/zh-Hans/UI/Angular/Localization.md index 8e30cb7a50..60af06a976 100644 --- a/docs/zh-Hans/UI/Angular/Localization.md +++ b/docs/zh-Hans/UI/Angular/Localization.md @@ -130,6 +130,68 @@ this.store.selectSnapshot( 本地化资源存储在 `ConfigState` 的 `localization` 属性中. +## RTL支持 + +从v2.9开始,ABP支持RTL. 如果使用v2.9及更高版本生成新项目,你无需进行任何更改. 如果要从早期版本迁移项目,请按照以下2个步骤操作: + +#### 步骤 1. 为 Bootstrap LRT和RTL创建Chunks + +在[angular.json中找到样式配置](https://angular.io/guide/workspace-config#style-script-config)确保项目中的chunks含有 `bootstrap-rtl.min` 和 `bootstrap-ltr.min`: + +```json +{ + "projects": { + "MyProjectName": { + "architect": { + "build": { + "options": { + "styles": [ + { + "input": "node_modules/@abp/ng.theme.shared/styles/bootstrap-rtl.min.css", + "inject": false, + "bundleName": "bootstrap-rtl.min" + }, + { + "input": "node_modules/bootstrap/dist/css/bootstrap.min.css", + "inject": true, + "bundleName": "bootstrap-ltr.min" + }, + { + "input": "node_modules/@fortawesome/fontawesome-free/css/all.min.css", + "inject": true, + "bundleName": "fontawesome-all.min" + }, + { + "input": "node_modules/@fortawesome/fontawesome-free/css/v4-shims.min.css", + "inject": true, + "bundleName": "fontawesome-v4-shims.min" + }, + "apps/dev-app/src/styles.scss" + ], + } + } + } + } + } +} + +#### 步骤 2. 清除AppComponent中延迟加载的Fontawesome + +如果你如上所述为Fontawesome创建并且注入了chunks,就不再需要v2.9版本之前的实现的 `AppComponent` 延迟加载. 删除它们即可,新版的 `AppComponent` 如下所示: + +```js +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-root', + template: ` + + + `, +}) +export class AppComponent {} +``` + ## 另请参阅 * [ASP.NET Core中的本地化](../../Localization.md) diff --git a/docs/zh-Hans/docs-nav.json b/docs/zh-Hans/docs-nav.json index 0111eabc31..d798580a25 100644 --- a/docs/zh-Hans/docs-nav.json +++ b/docs/zh-Hans/docs-nav.json @@ -430,6 +430,10 @@ "text": "到PostgreSQL", "path": "Entity-Framework-Core-PostgreSQL.md" }, + { + "text": " Oracle", + "path": "Entity-Framework-Core-Oracle.md" + }, { "text": "到SQLite", "path": "Entity-Framework-Core-SQLite.md"