diff --git a/docs/zh-Hans/Contribution/Index.md b/docs/zh-Hans/Contribution/Index.md index 058f195b0a..f3bafe9293 100644 --- a/docs/zh-Hans/Contribution/Index.md +++ b/docs/zh-Hans/Contribution/Index.md @@ -43,18 +43,20 @@ ABP框架具有灵活的[本地化系统](../Localization.md). 你可以为自 除此之外,框架和预构建模块已经本地化了文本.请参阅[Volo.Abp.UI包的本地化文本](https://github.com/abpframework/abp/blob/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json). -你可以在[相同文件夹](https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi)中创建一个新文件进行翻译. +#### 使用 "abp translate" 命令 -* 从Github克隆[ABP存储库](https://github.com/abpframework/abp/). -* 为本地化文本(json)文件(en.json文件同目录下)创建目标语言的新文件. -* 复制en.json文件中的所有文本. -* 翻译文本. -* 在Github上发送拉取请求(Pull request). +这是推荐的方法,因为它会自动查找所有缺少的文本的特定文化,让你在一个地方翻译. +* 从Github克隆[ABP存储库](https://github.com/abpframework/abp/). +* 安装[ABP CLI](https://docs.abp.io/en/abp/latest/CLI). +* 在abp仓储的根文件夹为你的语言运行`abp translate -c `命令. 例如对法语使用 `abp translate -c fr`, 检查[文档](https://docs.microsoft.com/en-us/bingmaps/rest-services/common-parameters-and-types/supported-culture-codes)找到你所用语言的文化代码. +* 命令会在同一文件夹下创建 `abp-translation.json` 文件, 使用你喜欢的编辑器打开这个文件并填写缺少的文本值. +* 一旦你完成了翻译,使用 `abp translate -a` 命令应用更改到相关的文件. +* 在GitHub上发送PR. -你还可以使用[ABP CLI](CLI.md)的`abp translation`命令来翻译本地化文本. +#### 手动翻译 -ABP是一个模块化框架. 所以有很多本地化文本资源, 每个模块都有一个. 要查找所有.json文件,可以在克隆存储库后搜索"en.json". 你还可以检查[此列表](Localization-Text-Files.md)以获取本地化文本文件列表. +如果你想更改特定的资源文件,你可以自己找到这个文件进行必要的更改(或为你的语言创建新文件),并在GitHub上发送PR。 ### 博客文章和教程 diff --git a/docs/zh-Hans/Entity-Framework-Core-Oracle.md b/docs/zh-Hans/Entity-Framework-Core-Oracle.md index 5156331f40..ee510e5edc 100644 --- a/docs/zh-Hans/Entity-Framework-Core-Oracle.md +++ b/docs/zh-Hans/Entity-Framework-Core-Oracle.md @@ -28,14 +28,14 @@ In the `CreateDbContext()` method of the *YourProjectName*MigrationsDbContextFac 使用以下代码替换*YourProjectName*MigrationsDbContextFactory.cs中的 `CreateDbContext()` 方法: -``` +```csharp var builder = new DbContextOptionsBuilder() .UseSqlServer(configuration.GetConnectionString("Default")); ``` 与这个 -``` +```csharp var builder = (DbContextOptionsBuilder) new DbContextOptionsBuilder().UseOracle ( @@ -51,12 +51,6 @@ Oracle连接字符串与SQL Server连接字符串不同. 所以检查你的解 通常需要更改 `.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提供程序会导致迁移失败. diff --git a/docs/zh-Hans/Object-To-Object-Mapping.md b/docs/zh-Hans/Object-To-Object-Mapping.md index 1b60112cb2..402acdc4f6 100644 --- a/docs/zh-Hans/Object-To-Object-Mapping.md +++ b/docs/zh-Hans/Object-To-Object-Mapping.md @@ -162,6 +162,61 @@ public class MyProfile : Profile 如果两个类都是可扩展对象(实现了 `IHasExtraProperties` 接口),建议使用 `MapExtraProperties` 方法. 更多信息请参阅[对象扩展文档](Object-Extensions.md). +### 其他有用的扩展方法 + +有一些扩展方法可以简化映射代码. + +#### 忽视审计属性 + +当你将一个对象映射到另一个对象时,通常会忽略审核属性. + +假设你需要将 `ProductDto` ([DTO](Data-Transfer-Objects.md))映射到Product[实体](Entities.md),该实体是从 `AuditedEntity` 类继承的(该类提供了 `CreationTime`, `CreatorId`, `IHasModificationTime` 等属性). + +从DTO映射时你可能想忽略这些基本属性,可以使用 `IgnoreAuditedObjectPropertie()` 方法忽略所有审计属性(而不是手动逐个忽略它们): + +````csharp +public class MyProfile : Profile +{ + public MyProfile() + { + CreateMap() + .IgnoreAuditedObjectProperties(); + } +} +```` + +还有更多扩展方法, 如 `IgnoreFullAuditedObjectProperties()` 和 `IgnoreCreationAuditedObjectProperties()`,你可以根据实体类型使用. + +> 请参阅[实体文档](Entities.md)中的"*基类和接口的审计属性*"部分了解有关审计属性的更多信息。 + +#### 忽视其他属性 + +在AutoMapper中,通常可以编写这样的映射代码来忽略属性: + +````csharp +public class MyProfile : Profile +{ + public MyProfile() + { + CreateMap() + .ForMember(x => x.CreationTime, map => map.Ignore()); + } +} +```` + +我们发现它的长度是不必要的并且创建了 `Ignore()` 扩展方法: + +````csharp +public class MyProfile : Profile +{ + public MyProfile() + { + CreateMap() + .Ignore(x => x.CreationTime); + } +} +```` + ## 高级主题 ### IObjectMapper 接口 diff --git a/docs/zh-Hans/Road-Map.md b/docs/zh-Hans/Road-Map.md index b764ce2e2e..f18441cb41 100644 --- a/docs/zh-Hans/Road-Map.md +++ b/docs/zh-Hans/Road-Map.md @@ -4,8 +4,28 @@ 虽然我们将**继续添加其他令人兴奋的功能**,但我们将在`中期`中处理以下主要项目: -* **gRPC 集成**和为所有预构建模块实现它. * 为所有预构建模块实现 **Blazor UI**. -* **.NET 5.0**! Microsoft宣布.NET 5.0将在2020年11月发布,我们将为此更改做准备并在Microsoft发布它之后立即迁移到.NET 5.0. 我们希望顺利过渡. +* **.NET 5.0**! Microsoft宣布.NET 5.0将在2020年11月发布,我们将为此更改做准备并在Microsoft发布它之后立即迁移到.NET 5.0. 我们希望顺利过渡.虽然已经可以为您的应用程序创建或使用gRPC端点,但我们计划为标准应用程序模块创建端点 -请在[GitHub仓库](https://github.com/abpframework/abpork/abp/milestones)为你的功能请求创建issue,但在创建前请先搜索是否已存在类似的issues. \ No newline at end of file +除了中期目录,还有一些[积压](https://github.com/abpframework/abp/milestone/2)的功能, 这里积压中重要功能的列表: + +* [#4098](https://github.com/abpframework/abp/issues/4098) / Blob存储Azure提供者. +* [#2882](https://github.com/abpframework/abp/issues/2882) / 提供 **gRPC集成** 基础设施 (虽然[已经可以](https://github.com/abpframework/abp-samples/tree/master/GrpcDemo)为你的应用程序创建和使用gRPC端点,但我们计划为所有[标准应用程序模块](https://docs.abp.io/en/abp/latest/Modules/Index)创建端点) +* [#236](https://github.com/abpframework/abp/issues/236) 基于权限系统的资源 +* [#1754](https://github.com/abpframework/abp/issues/1754) / 多语言实体 +* [#347](https://github.com/abpframework/abp/issues/347) / 支持MongoDB ACID事务 +* [#633](https://github.com/abpframework/abp/issues/633) / 实时通知系统 +* [#57](https://github.com/abpframework/abp/issues/57) / 内置CQRS基础设施 +* [#4222](https://github.com/abpframework/abp/issues/4222) / 分布式事件总线Kafka集成 +* [#336](https://github.com/abpframework/abp/issues/336) / 健康检查抽象 +* [#2532](https://github.com/abpframework/abp/issues/2532), [#2564](https://github.com/abpframework/abp/issues/2465) / EF Core 与 MongoDB API 集成CosmosDB +* [#1168](https://github.com/abpframework/abp/issues/1168) / Vue 启动模板 +* [#1638](https://github.com/abpframework/abp/issues/1638) React 启动模板 +* [#4223](https://github.com/abpframework/abp/issues/4223) / WebHook系统 +* [#162](https://github.com/abpframework/abp/issues/162) / 为多租户集成Azure ElasticDB +* [#2296](https://github.com/abpframework/abp/issues/2296) / 功能切换基础架构 + +积压的项目有可能发生变化. 我们将根据社区反馈和项目目标添加新项目与更改优先级. + +在Github相关issue为你感兴趣的功能投票(并写下你的想法) +. 你可以在[GitHub仓库](https://github.com/abpframework/abpork/abp/milestones)为你的功能请求创建issue,但在创建前请先搜索是否已存在类似的issues. \ No newline at end of file