Skip to content

Commit

Permalink
Update asp0018.md (#31168)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminMichaelis committed Nov 30, 2023
1 parent 6c3c6b3 commit 6229459
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion aspnetcore/diagnostics/asp0018.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ A route parameter is specified but not used.

## Rule description

A route parameter is specified but not used. In the example below, the `name` parameter is defined in the route but not in the route handler.
A route parameter is specified but not used. In the example below, the `id` parameter is defined in the route but not in the route handler.

```csharp
var app = WebApplication.Create();
Expand All @@ -32,6 +32,11 @@ app.MapGet("/{id}", () => ...);
## How to fix violations

To fix a violation of this rule, remove the route parameter or add code that uses the parameter.
```csharp
var app = WebApplication.Create();

app.MapGet("/{id}", (id) => ...);
```

## When to suppress warnings

Expand Down

0 comments on commit 6229459

Please sign in to comment.