Question about routing in the context of a .NET 8 Blazor Webassembly application.I want to achieve the following URL's:
- /{store-slug}/products/{product-slug}
- /{store-slug}/checkout
- /{store-slug}/login
- ...
problem statement
I understand I can easily do this by adding [Parameter] properties within the specific page. But this is going to be big project and I want to avoid dealing with fetching the store on each & every page.
Thought process
Ideally my {store-slug} logic can all be handled from within my MainLayout.razor.This would allow me to simplify my productdetail.razor page for example:@page "/products/{product-detail}" instead of @page "/{store-slug}/products/{product-slug}".
What I'm trying to achieve is very similar to ASP.NET MVC AREAS. Anyone can guide me in the right direction? Adding the [Parameter] to my MainLayout.razor is not working. I've checked in with ChatGPT but nothing usefull is coming out, it's hinting towards modifying my app.razor routing, but nothing that really makes sense.
Thanks in advance for the help.