Class ControllerRegistry

Assembly: redb.Route.Controllers.dll

Scans assemblies for subclasses, builds a route lookup table,
and resolves incoming (method, path) pairs to controller actions.
Thread-safe. Lookup is O(n) on segments but typically fast given small route counts.

public sealed class ControllerRegistry

Inheritance

Object→ControllerRegistry

Properties

Actions

Returns all registered controller actions.

public IReadOnlyCollection<ControllerAction> Actions { get; }

Methods

RegisterAssembly(Assembly)

Scans an assembly for all non-abstract subclasses

public int RegisterAssembly(Assembly assembly)

RegisterController(Type)

Registers a single controller type and its attributed actions.

public int RegisterController(Type controllerType)

Resolve(HttpMethodType, string, out Dictionary<string, string>)

Matches an incoming request path and HTTP method against the route table.

public ControllerAction? Resolve(HttpMethodType httpMethod, string path, out Dictionary<string, string> routeParams)

Resolve(string, string, out Dictionary<string, string>)

Resolves using string method name (case-insensitive) instead of enum.

public ControllerAction? Resolve(string httpMethod, string path, out Dictionary<string, string> routeParams)