class

Analyzer::VB::AspNetMvc

Inherits Analyzer::CSharp::Common < Analyzer < FileHelper < Reference < Object

VB.NET controllers for ASP.NET MVC 5, Web API 2 and ASP.NET Core. The routing model is the C# one; only the syntax differs — <HttpGet> for [HttpGet], Inherits ApiController for : ApiController, Function X(id As Integer) for X(int id), case-insensitive keywords.

Actions without an attribute route are expanded through the project's conventional route table (MapHttpRoute for Web API 2, MapRoute / MapControllerRoute for MVC), falling back to the framework defaults.

Constants

ACCEPT_VERBS = /\bAcceptVerbs\s*\(([^)]*)\)/i
ACTION_NAME_RE = /\bActionName\s*\(\s*"([^"]+)"/i
BINDING_NAME = /\bFrom\w+\s*\(\s*(?:Name\s*:=\s*)?"([^"]+)"/i
BINDING_RE = /\bFrom(Body|Uri|Query|Route|Header|Form|Services|KeyedServices)\b/i
BINDING_TYPES = {"body" => "json", "uri" => "query", "query" => "query", "route" => "path", "header" => "header", "form" => "form"}
CLASS_RE = /\A(?:(?:Public|Friend|Private|Protected|Partial|MustInherit|NotInheritable)\s+)*Class\s+(\w+)/i
CONTROLLER_RE = /\bInherits\s+[\w.]*Controller(?:Base)?\b/i
END_CLASS_RE = /\AEnd\s+Class\b/i
HTTP_ATTR_RE = /\bHttp(Get|Post|Put|Delete|Patch|Head|Options)(?:Attribute)?\b(?:\s*\(\s*"([^"]*)")?/i
INHERITS_RE = /\bInherits\s+([\w.]+)/i
LEADING_ATTR = /\A<((?:[^<>"]|"[^"]*")*)>\s*/
MAP_ROUTE_RE = /\.Map(Http|Controller)?Route\s*\(/i
METHOD_RE = /\A((?:(?:Public|Private|Protected|Friend|Shared|Overridable|Overrides|NotOverridable|Overloads|Shadows|Async|Iterator)\s+)*)(?:Function|Sub)\s+(\w+)/i
NAMED_ROUTE_RE = /\b(?:url|routeTemplate|pattern)\s*:=\s*"([^"]*)"/i
NON_PUBLIC_RE = /\b(?:Private|Protected|Friend|Shared|Overrides)\b/i
PARAM_MODS = /\A(?:(?:ByVal|ByRef|Optional|ParamArray)\s+)+/i
PLACEHOLDER_RE = /\{([^{}]+)\}/
ROUTE_ATTR_RE = /\bRoute(?:Prefix)?(?:Attribute)?\s*\(\s*"([^"]*)"/i
STRING_RE = /"((?:[^"]|"")*)"/
VERB_PREFIX_RE = /\A(Get|Post|Put|Delete|Patch|Head|Options)/i
VERB_WORD_RE = /\b(Get|Post|Put|Delete|Patch|Head|Options)\b/i

Class methods

tech_name
Source

Instance methods

analyze
Source
tech

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.

Source