10 references to HasAttribute
Microsoft.AspNetCore.Mvc.Analyzers (4)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (1)
79
type.
HasAttribute
(pageAttributeModel, inherit: true);
src\Shared\Roslyn\MvcFacts.cs (2)
43
if (type.
HasAttribute
(nonControllerAttribute, inherit: true))
49
!type.
HasAttribute
(controllerAttribute, inherit: true))
TopLevelParameterNameAnalyzer.cs (1)
57
if (method.ContainingType.
HasAttribute
(symbolCache.IApiBehaviorMetadata, inherit: true))
Mvc.Analyzers.Test (6)
CodeAnalysisExtensionsTest.cs (6)
479
var classHasAttribute = CodeAnalysisExtensions.
HasAttribute
(testClass, attribute, inherit: false);
507
var hasAttribute = CodeAnalysisExtensions.
HasAttribute
(testClass, attribute, inherit: false);
533
var hasAttributeWithoutInherit = CodeAnalysisExtensions.
HasAttribute
(testClass, attribute, inherit: false);
534
var hasAttributeWithInherit = CodeAnalysisExtensions.
HasAttribute
(testClass, attribute, inherit: true);
564
var hasAttribute = CodeAnalysisExtensions.
HasAttribute
(testClass, @interface, inherit: true);
565
var hasAttributeOnDerived = CodeAnalysisExtensions.
HasAttribute
(testClass, @interface, inherit: true);