mina shaker

mina shaker

  • 1.6k
  • 119
  • 6.1k

How Dose MapControllerRoute() works in asp.net Core ?

Sep 21 2024 11:30 PM

hi 
i was reading about MapControllerRoute()  what i understansed that i has two main processes 

  1. defining the Route Templates and there crosponding pattern 
  2. add thos route template to the routes table (that the UseRouting() use when matching incomming request with the route template in the route table);
  3. Run the UseEndponints() that excutes the suitable action according to the matched url 

 what i want to ask is the part of the defining the route template and there crospnding pattern, the app includes only one patten that are defined throught the MapControllerRoute() like below code , then i have 3 controller action in my Homecontroller class then haw many template will be added to the table
 

            app.MapControllerRoute(
                name: "default",
                pattern: "{controller=Home}/{action=Index}/{id?}");

 


Answers (5)