c# - Add client name in custom routing -


i want add client name in each , every route in .net core application. not want add in each controller using route or routeprefix. should available controllers. so,how can ?

lets have following routes

  1. mysite.com/virtualdir1/clientname/login

  2. mysite.com/virtualdir1/clientname/dashboard

  3. mysite.com/virtualdir1/clientname/home

  4. mysite.com/virtualdir1/clientname/aboutus

i have tried setup in startup.cs file follows gives 404 error

 app.usemvc(routes =>             {                 routes.maproute(                     name: "backend",                     template: "{clientname}/{controller=home}/{action=login}");              }); 

thanks !


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -