Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.42 KB

ASP004.md

File metadata and controls

50 lines (36 loc) · 1.42 KB

ASP004

Route parameter type does not match the method parameter type

Topic Value
Id ASP004
Severity Warning
Enabled True
Category AspNetCoreAnalyzers.Routing
Code AttributeAnalyzer

Description

Route parameter type does not match the method parameter type.

Motivation

ADD MOTIVATION HERE

How to fix violations

ADD HOW TO FIX VIOLATIONS HERE

Configure severity

Via ruleset file.

Configure the severity per project, for more info see MSDN.

Via #pragma directive.

#pragma warning disable ASP004 // Route parameter type does not match the method parameter type
Code violating the rule here
#pragma warning restore ASP004 // Route parameter type does not match the method parameter type

Or put this at the top of the file to disable all instances.

#pragma warning disable ASP004 // Route parameter type does not match the method parameter type

Via attribute [SuppressMessage].

[System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing", 
    "ASP004:Route parameter type does not match the method parameter type", 
    Justification = "Reason...")]