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] 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