parent
784f1cf4f9
commit
d0c5d5e829
|
@ -22,7 +22,7 @@ A route parameter is declared as required in the Delegate definition but is mark
|
||||||
|
|
||||||
## Rule description
|
## Rule description
|
||||||
|
|
||||||
When an endpoint is declared, optionality of parameters can be declared in both the route template and in the route handler arguments. When a parameter is declared as optional in the handler, it must also be declared as optional in the route template. For example, GET `/todos` fails to resolve a match for the following following code:
|
When an endpoint is declared, optionality of parameters can be declared in both the route template and in the route handler arguments. When a parameter is declared as optional in the handler, it must also be declared as optional in the route template. For example, GET `/todos` fails to resolve a match for the following code:
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
app.MapGet("/todos/{id}", (int? id) => {});
|
app.MapGet("/todos/{id}", (int? id) => {});
|
||||||
|
|
Loading…
Reference in New Issue