Reading-Notes

Navigation Properties and Routing

This topic is important to me because I want to have code that is reusable and more organized.

Retrospective 14

References

Routing within MVC

Routing within Core

Routing within MVC

Routing in an MVC (Model-View-Controller) application refers to the process of determining how incoming URLs should be mapped to controllers and actions in order to handle user requests. It’s a crucial mechanism that allows the application to understand which controller and action should be invoked based on the URL provided by the user.

Routing in MVC serves as a bridge between the user’s request and the appropriate code that should handle that request.

This is how it works: URL Parsing, Route Configuration, Route Matching, Controller and Action Selection, Parameter Binding, Action Execution.

Routing provides a way to create clean and user-friendly URLs for different parts of an application, making the application’s structure more intuitive for both users and developers. It allows for the separation of concerns, where the routing logic handles the URL-to-action mapping, and the controllers handle the specific business logic for each action.

Routing in ASP.NET Core

Overview

Routing in ASP.NET Core follows the same fundamental principles as ASP.NET MVC, but with some differences due to the modular and flexible nature of the ASP.NET Core framework.

Key Concepts

Routing in ASP.NET Core

Attribute-Based Routing

Convention-Based Routing

Route Templates

Route Constraints

Areas and Routes

URL Generation

Benefits

Practical Use Cases

Conclusion

Routing is a fundamental aspect of ASP.NET Core that enables the mapping of URLs to actions in controllers. Whether using attribute-based or convention-based routing, understanding how routing works is crucial for building organized and user-friendly web applications.

Things I want to know more about

I want to learn how to build my own API’s using the best techniques.

I want to learn the importance of routing within MVC and Core, and the differences.