Pages
- M
- Model
- defines Data
- C
- Controller
- defines Action
- No View!
- This is for data commnication
- It doen’t need UI
Code
- Controllers\ValueController.cs
- Models\HelloMessage.cs
- Startup.cs
Route
- [Route(string)]
- define how to match urls
- In Web API, it match urls with controllers’ name
API Controller
- ApiController Attribute
- The [ApiController] attribute can be applied to a controller class to enable the following opinionated, API-specific behaviors:
Attribute routing requirement
Automatic HTTP 400 responses
Binding source parameter inference
Multipart/form-data request inference
Problem details for error status codes
- The [ApiController] attribute can be applied to a controller class to enable the following opinionated, API-specific behaviors:
Startup.cs
- AddControllers
- Adds services for controllers to the specified IServiceCollection.
- MapControllers
- Adds endpoints for controller actions to the IEndpointRouteBuilder without specifying any routes.
- Rounting is in Controller