Skip to content

EndpointResolver Class

Resolves a fully qualified URI for a specific controller and action based on ASP.NET Core's endpoint routing.

C#
public class EndpointResolver : Abblix.Oidc.Server.Mvc.Features.EndpointResolving.IEndpointResolver

Inheritance System.Object → EndpointResolver

Implements IEndpointResolver

Constructors

EndpointResolver(ILogger<EndpointResolver>, EndpointDataSource, IUriResolver) Constructor

Resolves a fully qualified URI for a specific controller and action based on ASP.NET Core's endpoint routing.

C#
public EndpointResolver(Microsoft.Extensions.Logging.ILogger<Abblix.Oidc.Server.Mvc.Features.EndpointResolving.EndpointResolver> logger, Microsoft.AspNetCore.Routing.EndpointDataSource endpointDataSource, Abblix.Oidc.Server.Mvc.IUriResolver uriResolver);

Parameters

logger Microsoft.Extensions.Logging.ILogger<EndpointResolver>

The logger for debugging endpoint resolution.

endpointDataSource Microsoft.AspNetCore.Routing.EndpointDataSource

The endpoint data source that provides access to all configured route endpoints in the application.

uriResolver IUriResolver

The URI resolver used to convert relative paths to absolute URIs.

Methods

EndpointResolver.Resolve(string, string) Method

Resolves the absolute URI for a given controller and action based on the configured routes.

C#
public System.Uri? Resolve(string controllerName, string actionName);

Parameters

controllerName System.String

The name of the controller (without the "Controller" suffix).

actionName System.String

The name of the action method.

Implements Resolve(string, string)

Returns

System.Uri
A System.Uri representing the absolute route to the specified controller and action, or null if no matching route was found.

Remarks

This method matches endpoints based on Microsoft.AspNetCore.Mvc.Controllers.ControllerActionDescriptor metadata. The resulting URI is based on the route pattern's raw template and the base URL from the current request context.