I have a asp.net web forms I am converting to .NET CORE. The website has many users managing multiple customers in the system. The users need to be able to manage customers from multiple browser tabs. My web old application simply passed the parameter CustomerId, and I had to manage the CustomerId value across multiple pages which was a pain. All pages had to use the query ?CustomerId=XXX
In ASP.net Core 3, is there is simple way to do this in routes and construct URLs? I would like to add a route that looks like this?
http://mywebsite.com/customer/XXX/SettingsPage this would route to a razor page /Pages/SettingsPage.cshtml
http://mywebsite.com/customer/XXX/AdminArea/Users/Edit1 this would route to an area with a razor page /Areas/AdminArea/Users/Edit.cshtml
Then in my code I can create URLs from the route and fetch the XXX value and query the customer table.