Hello mina shaker ,
Thanks for reaching out on Microsoft Q and A.
In ASP.NET Core, routing is how the app decides which code to run based on the URL. When a request comes in, it matches the URL against the route templates you've defined, usually in the Startup.cs
or Program.cs
file. If it finds a match, it directs the request to the correct controller action to handle it.
For example, routes are defined like this:
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});
These routes are set up in the code and stored in memory, ready to handle requests as soon as your app starts.
Hope this helps! If you have any more questions, just let me know!
If this information helps, please upvote and accept this answer to close the thread. Thanks!