Analyzer::CSharp::AspNetCoreMvc
Inherits Analyzer::CSharp::Common < Analyzer < FileHelper < Reference < Object
Constants
ASP.NET Core routing has always accepted an arbitrary method string
through [AcceptVerbs(...)]; QUERY (RFC 10008) ships natively as
HttpMethods.Query starting with .NET 10.
Discovery reads the whole solution, so the gate in front of CSharpLexer
decides what the analyzer costs: bitwarden/server ships 5,512 .cs files
and 277 controllers, and lexing all of them is a 5-6x scan.
Every intrinsic controller marker is visible in the declaring source —
the *Controller name suffix, [Controller]/[ApiController], and the
Controller/ControllerBase framework bases. Those files are lexed
up front. A type can still inherit a marker from a local base
(class Users : BaseApiEndpoint), so the files that name one of the
marked types are pulled in afterwards, and those that never spell
Controller at all only have to be checked against marked names that
do not spell it either — in practice none, so the bulk of a solution is
never read past the substring test.
An IApplicationModelConvention that combines a constant
RouteAttribute with every controller selector, registered with
Conventions.Add(new ApiRoutePrefixConvention("api")): its prefix leads
every attribute route of the project. The template is the class's own
new RouteAttribute("api") literal, else the registration's first
argument ("api" or new RouteAttribute("api")).
The area route every MVC template ships: what serves an [Area]
controller when the scan shows no route that reaches its area.
Only a class with a base list can inherit a marker it does not declare.
The request source each [FromX] attribute binds a parameter from.
A route argument that is a name (ApiRoutes.Item, Const + "/x"): the
route exists but cannot be read here, so the action is reported at the
class route with an unresolved-route tag.
Class methods
Instance methods
Instance-side view of the same declaration. The per-file rescues live on
this base class, which has no way to name the analyzer that is running
inside them, so a skipped file could not be attributed to a tech.
Deriving it from analyzer_for keeps the name written exactly once.