From eb552cc6882eb980dcc4f2378dbc1885d3c1337e Mon Sep 17 00:00:00 2001 From: maliming <6908465+maliming@users.noreply.github.com> Date: Fri, 24 Jul 2020 12:12:12 +0800 Subject: [PATCH 1/2] Map the BookStore code namespace. --- docs/en/Tutorials/Part-6.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/en/Tutorials/Part-6.md b/docs/en/Tutorials/Part-6.md index 1bb07007b6..0f8edb4601 100644 --- a/docs/en/Tutorials/Part-6.md +++ b/docs/en/Tutorials/Part-6.md @@ -242,6 +242,15 @@ This is a unique string represents the error code thrown by your application and "BookStore:00001": "There is already an author with the same name: {name}" ```` +Then open the `BookStoreDomainSharedModule` and add the following code block inside the `ConfigureServices` method: + +````csharp +Configure(options => +{ + options.MapCodeNamespace("BookStore", typeof(BookStoreResource)); +}); +```` + Whenever you throw an `AuthorAlreadyExistsException`, the end use will see a nice error message on the UI. ## IAuthorRepository From 1c23764e0b3cd55aa447751e93dbcd06c25d90d3 Mon Sep 17 00:00:00 2001 From: cuibty Date: Fri, 24 Jul 2020 14:45:16 +0800 Subject: [PATCH 2/2] Update Unit-Of-Work.md --- docs/zh-Hans/Unit-Of-Work.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/zh-Hans/Unit-Of-Work.md b/docs/zh-Hans/Unit-Of-Work.md index 0fbf5762f0..b937c86ac0 100644 --- a/docs/zh-Hans/Unit-Of-Work.md +++ b/docs/zh-Hans/Unit-Of-Work.md @@ -21,7 +21,7 @@ ABP的UOW系统是; UOW自动针对这些方法开始,除非**周围已经有一个(环境)**UOW在运行.示例; -* 如果你调用一个[仓储]方法(Repositories.md),但还没有启动UOW,它将自动**启动一个新的事务UOW**,其中包括在仓储方法中完成的所有操作,如果仓储方法没有抛出任何异常,则**提交事务**. 仓储方法根本不知道UOW或事务. 它只在一个常规的数据库对象上工作(例如用于[EF Core](Entity-Framework-Core.md)的`DbContext`),而UOW由ABP框架处理. +* 如果你调用一个[仓储](Repositories.md)方法,但还没有启动UOW,它将自动**启动一个新的事务UOW**,其中包括在仓储方法中完成的所有操作,如果仓储方法没有抛出任何异常,则**提交事务**. 仓储方法根本不知道UOW或事务. 它只在一个常规的数据库对象上工作(例如用于[EF Core](Entity-Framework-Core.md)的`DbContext`),而UOW由ABP框架处理. * 如果调用[应用服务](Application-Services.md)方法,则相同的UOW系统将按上述说明工作. 如果应用服务方法使用某些仓储,这些仓储**不会开始新的UOW**,而是**参与由ABP框架为应用程序服务方法启动的当前工作单元中**. * ASP.NET Core控制器操作也是如此. 如果操作以控制器action开始,**UOW范围是控制器action的方法主体**. @@ -352,4 +352,4 @@ public async Task CreateAsync(string name) ````csharp app.UseUnitOfWork(); app.UseConfiguredEndpoints(); -```` \ No newline at end of file +````