Skip to content

Commit f2ada3d

Browse files
committed
C#: Also use using namespace as a hint to indicate that ASP.NET Core is in scope.
1 parent a7011e1 commit f2ada3d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

csharp/ql/lib/semmle/code/csharp/frameworks/microsoft/AspNetCore.qll

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,13 @@ class MicrosoftAspNetCoreMvcControllerBaseClass extends Class {
196196
*/
197197
class MicrosoftAspNetCoreMvcController extends Class {
198198
MicrosoftAspNetCoreMvcController() {
199-
exists(Assembly a |
200-
a.getName() = ["Microsoft.AspNetCore.Mvc.Core", "Microsoft.AspNetCore.Mvc.ViewFeatures"]
199+
(
200+
exists(Assembly a |
201+
a.getName() = ["Microsoft.AspNetCore.Mvc.Core", "Microsoft.AspNetCore.Mvc.ViewFeatures"]
202+
) or
203+
exists(UsingNamespaceDirective ns |
204+
ns.getImportedNamespace() instanceof MicrosoftAspNetCoreMvcNamespace
205+
)
201206
) and
202207
this.isPublic() and
203208
not this.isAbstract() and

0 commit comments

Comments
 (0)