From 8e2cf9b688f74ef57625945a9c9e58112d4be6f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 7 Dec 2020 18:43:14 +0300 Subject: [PATCH] Documented Blazor routing. --- docs/en/UI/Blazor/Routing.md | 23 ++++++++++++++++++++++- docs/en/docs-nav.json | 4 ++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/en/UI/Blazor/Routing.md b/docs/en/UI/Blazor/Routing.md index 85b4273dad..31a5637b51 100644 --- a/docs/en/UI/Blazor/Routing.md +++ b/docs/en/UI/Blazor/Routing.md @@ -1,3 +1,24 @@ # Blazor UI: Routing -TODO \ No newline at end of file +Blazor has its own [routing system](https://docs.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing) and you can use it in your applications. ABP doesn't add any new feature to it, except one small improvement for the [modular development](../../Module-Development-Basics.md). + +## AbpRouterOptions + +Blazor `Router` component requires to define `AdditionalAssemblies` when you have components in assemblies/projects other than the main application's entrance assembly. So, if you want to create razor class libraries as ABP modules, you typically want to add the module's assembly to the `AdditionalAssemblies`. In this case, you need to add your module's assembly to the `AbpRouterOptions`. + +**Example** + +````csharp +Configure(options => +{ + options.AdditionalAssemblies.Add(typeof(MyBlazorModule).Assembly); +}); +```` + +Write this code in the `ConfigureServices` method of your [module](../../Module-Development-Basics.md). + +`AbpRouterOptions` has another property, `AppAssembly`, which should be the entrance assembly of the application and typically set in the final application's module. If you've created your solution with the [application startup template](../../Startup-Templates/Application.md), it is already configured for you. + +## See Also + +* [Blazor Routing](https://docs.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing) (Microsoft Documentation) \ No newline at end of file diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 75a683730a..bacd74cbe6 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -708,6 +708,10 @@ { "text": "Global Scripts & Styles", "path": "UI/Blazor/Global-Scripts-Styles.md" + }, + { + "text": "Routing", + "path": "UI/Blazor/Routing.md" } ] },