A sample .NET 7 Minimal API app that shows the basics of using Routing. It shows how to use URL, Methods and Binding to handle request and offer a simple way to organize the project's code. (It's missing validation and error handling)
Check commits for steps and how to apply different concepts
-
Routing (URL/Method)
-
Parameter binding:
- Route (URL)
- Body
- Query
- Services
- Headers
-
Use C# attribute to specify binding:
[FromRoute]
[FromBody]
[FromQuery]
[FromServices]
[FromHeader]
-
Classes
- Fields
- Properties
- Methods/lambda expressions
-
Value and reference types
-
Records