Syntactically, attribute routes are defined as follows:
[HttpMethod("Template URI", Name?, Order?)]
- Based on HttpVerbs, ASP.NET Core provides these HttpMethods to be used for attribute routes--HttpDeleteAttribute, HttpGetAttribute, HttpHeadAttribute, HttpOptionsAttribute, HttpPatchAttribute, HttpPostAttribute, and HttpPutAttribute.
- Template URI is string that describes routes.
- Name--it's the optional name given to the attribute route. It is usually used when actions seem to be overloaded methods.
- Orders help to take precedence in the execution of overloaded HTTP methods in the controller. Orders depend on literals, parameters, constraints, and also Order. This is an optional parameter.
With these ...