88using Microsoft . CodeAnalysis . Diagnostics ;
99using Microsoft . CodeAnalysis . Operations ;
1010
11- namespace Microsoft . AspNetCore . Analyzers . MinimalActions ;
11+ namespace Microsoft . AspNetCore . Analyzers . DelegateEndpoints ;
1212
1313[ DiagnosticAnalyzer ( LanguageNames . CSharp ) ]
14- public partial class MinimalActionAnalyzer : DiagnosticAnalyzer
14+ public partial class DelegateEndpointAnalyzer : DiagnosticAnalyzer
1515{
1616 public override ImmutableArray < DiagnosticDescriptor > SupportedDiagnostics { get ; } = ImmutableArray . Create ( new [ ]
1717 {
18- DiagnosticDescriptors . DoNotUseModelBindingAttributesOnMinimalActionParameters ,
18+ DiagnosticDescriptors . DoNotUseModelBindingAttributesOnDelegateEndpointParameters ,
1919 } ) ;
2020
2121 public override void Initialize ( AnalysisContext context )
@@ -35,7 +35,7 @@ public override void Initialize(AnalysisContext context)
3535 {
3636 var invocation = ( IInvocationOperation ) operationAnalysisContext . Operation ;
3737 var targetMethod = invocation . TargetMethod ;
38- if ( IsMapActionInvocation ( wellKnownTypes , invocation , targetMethod ) )
38+ if ( IsDelegateHandlerInvocation ( wellKnownTypes , invocation , targetMethod ) )
3939 {
4040 return ;
4141 }
@@ -60,13 +60,13 @@ public override void Initialize(AnalysisContext context)
6060 } ) ;
6161 }
6262
63- private static bool IsMapActionInvocation (
63+ private static bool IsDelegateHandlerInvocation (
6464 WellKnownTypes wellKnownTypes ,
6565 IInvocationOperation invocation ,
6666 IMethodSymbol targetMethod )
6767 {
6868 return ! targetMethod . Name . StartsWith ( "Map" , StringComparison . Ordinal ) ||
69- ! SymbolEqualityComparer . Default . Equals ( wellKnownTypes . MinimalActionEndpointRouteBuilderExtensions , targetMethod . ContainingType ) ||
69+ ! SymbolEqualityComparer . Default . Equals ( wellKnownTypes . DelegateEndpointRouteBuilderExtensions , targetMethod . ContainingType ) ||
7070 invocation . Arguments . Length != 3 ;
7171 }
7272}
0 commit comments