#### [Abblix\.Oidc\.Server\.Mvc](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc 'index')
### [Abblix\.Oidc\.Server\.Mvc](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc 'Abblix\.Oidc\.Server\.Mvc')

## UriResolver Class

Provides functionality to generate absolute URIs for MVC actions and content within an ASP\.NET Core application\.
This class utilizes ASP\.NET Core's [Microsoft\.AspNetCore\.Http\.IHttpContextAccessor](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.ihttpcontextaccessor 'Microsoft\.AspNetCore\.Http\.IHttpContextAccessor') to access the current HTTP context
and [Microsoft\.AspNetCore\.Mvc\.Routing\.IUrlHelperFactory](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routing.iurlhelperfactory 'Microsoft\.AspNetCore\.Mvc\.Routing\.IUrlHelperFactory') to create URL helpers for generating URIs\.

```csharp
public class UriResolver : Abblix.Oidc.Server.Mvc.IUriResolver
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → UriResolver

Implements [IUriResolver](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.IUriResolver 'Abblix\.Oidc\.Server\.Mvc\.IUriResolver')
### Constructors

## UriResolver\(IHttpContextAccessor, IUrlHelperFactory, IOptions\<MvcOptions\>\) Constructor {#Abblix.Oidc.Server.Mvc.UriResolver.UriResolver(Microsoft.AspNetCore.Http.IHttpContextAccessor,Microsoft.AspNetCore.Mvc.Routing.IUrlHelperFactory,Microsoft.Extensions.Options.IOptions_Microsoft.AspNetCore.Mvc.MvcOptions_)}

Provides functionality to generate absolute URIs for MVC actions and content within an ASP\.NET Core application\.
This class utilizes ASP\.NET Core's [Microsoft\.AspNetCore\.Http\.IHttpContextAccessor](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.ihttpcontextaccessor 'Microsoft\.AspNetCore\.Http\.IHttpContextAccessor') to access the current HTTP context
and [Microsoft\.AspNetCore\.Mvc\.Routing\.IUrlHelperFactory](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routing.iurlhelperfactory 'Microsoft\.AspNetCore\.Mvc\.Routing\.IUrlHelperFactory') to create URL helpers for generating URIs\.

```csharp
public UriResolver(Microsoft.AspNetCore.Http.IHttpContextAccessor httpContextAccessor, Microsoft.AspNetCore.Mvc.Routing.IUrlHelperFactory urlHelperFactory, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Mvc.MvcOptions> mvcOptions);
```
#### Parameters

###### `httpContextAccessor` [Microsoft\.AspNetCore\.Http\.IHttpContextAccessor](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.ihttpcontextaccessor 'Microsoft\.AspNetCore\.Http\.IHttpContextAccessor') {#Abblix.Oidc.Server.Mvc.UriResolver.UriResolver(Microsoft.AspNetCore.Http.IHttpContextAccessor,Microsoft.AspNetCore.Mvc.Routing.IUrlHelperFactory,Microsoft.Extensions.Options.IOptions_Microsoft.AspNetCore.Mvc.MvcOptions_).httpContextAccessor}

The accessor used to obtain the current [Microsoft\.AspNetCore\.Http\.HttpContext](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httpcontext 'Microsoft\.AspNetCore\.Http\.HttpContext'),
            providing context for generating URLs, such as the current request's scheme and host\.

###### `urlHelperFactory` [Microsoft\.AspNetCore\.Mvc\.Routing\.IUrlHelperFactory](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.routing.iurlhelperfactory 'Microsoft\.AspNetCore\.Mvc\.Routing\.IUrlHelperFactory') {#Abblix.Oidc.Server.Mvc.UriResolver.UriResolver(Microsoft.AspNetCore.Http.IHttpContextAccessor,Microsoft.AspNetCore.Mvc.Routing.IUrlHelperFactory,Microsoft.Extensions.Options.IOptions_Microsoft.AspNetCore.Mvc.MvcOptions_).urlHelperFactory}

The factory used to create instances of [Microsoft\.AspNetCore\.Mvc\.IUrlHelper](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.iurlhelper 'Microsoft\.AspNetCore\.Mvc\.IUrlHelper'),
            which facilitates the generation of URLs for actions and content\.

###### `mvcOptions` [Microsoft\.Extensions\.Options\.IOptions&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1')[Microsoft\.AspNetCore\.Mvc\.MvcOptions](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.mvcoptions 'Microsoft\.AspNetCore\.Mvc\.MvcOptions')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1') {#Abblix.Oidc.Server.Mvc.UriResolver.UriResolver(Microsoft.AspNetCore.Http.IHttpContextAccessor,Microsoft.AspNetCore.Mvc.Routing.IUrlHelperFactory,Microsoft.Extensions.Options.IOptions_Microsoft.AspNetCore.Mvc.MvcOptions_).mvcOptions}

The MVC options used to access registered conventions for route template resolution\.
### Methods

## UriResolver\.Action\(string, string, object\) Method {#Abblix.Oidc.Server.Mvc.UriResolver.Action(string,string,object)}

Generates an absolute URI for a specified controller action, enabling action methods to be easily referenced
across the application for things like redirects or link generation\.

```csharp
public System.Uri Action(string actionName, string controllerName, object? routeValues=null);
```
#### Parameters

###### `actionName` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Mvc.UriResolver.Action(string,string,object).actionName}

The name of the action method within the controller\.

###### `controllerName` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Mvc.UriResolver.Action(string,string,object).controllerName}

The name of the controller that contains the action method\.

###### `routeValues` [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') {#Abblix.Oidc.Server.Mvc.UriResolver.Action(string,string,object).routeValues}

An object containing the route values for the action method\. These values are used to
            construct the query string and populate parameters in the route template\. This parameter is optional\.

Implements [Action\(string, string, object\)](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.IUriResolver#Abblix.Oidc.Server.Mvc.IUriResolver.Action(string,string,object) 'Abblix\.Oidc\.Server\.Mvc\.IUriResolver\.Action\(string, string, object\)')

#### Returns
[System\.Uri](https://learn.microsoft.com/en-us/dotnet/api/system.uri 'System\.Uri')  
An absolute URI as a [System\.Uri](https://learn.microsoft.com/en-us/dotnet/api/system.uri 'System\.Uri') object for the specified action within the controller\.

### Example

```csharp
var uri = uriResolver.Action("Index", "Home", new { id = 42 });
// Result could be something like: "http://example.com/Home/Index?id=42"
```

## UriResolver\.Content\(string\) Method {#Abblix.Oidc.Server.Mvc.UriResolver.Content(string)}

Generates an absolute URI for a given content path\. This method is useful for creating links to static resources
stored within the application, such as images, CSS files, and JavaScript files\. It supports:
\- Application root\-relative paths using the '~' symbol \(e\.g\., "~/images/logo\.png"\)
\- Route template constants from [Path](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Path 'Abblix\.Oidc\.Server\.Mvc\.Path') class \(e\.g\., [Authorize](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Path#Abblix.Oidc.Server.Mvc.Path.Authorize 'Abblix\.Oidc\.Server\.Mvc\.Path\.Authorize')\)
\- Regular relative paths

```csharp
public System.Uri Content(string path);
```
#### Parameters

###### `path` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Mvc.UriResolver.Content(string).path}

The path to the content\. This can be:
             \- A virtual path \(e\.g\., "~/images/logo\.png"\) indicating the application root
             \- A route template constant \(e\.g\., Path\.Authorize = "\[route:authorize?~/connect/authorize\]"\)
             \- A relative path from the current executing location

Implements [Content\(string\)](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.IUriResolver#Abblix.Oidc.Server.Mvc.IUriResolver.Content(string) 'Abblix\.Oidc\.Server\.Mvc\.IUriResolver\.Content\(string\)')

#### Returns
[System\.Uri](https://learn.microsoft.com/en-us/dotnet/api/system.uri 'System\.Uri')  
An absolute URI as a [System\.Uri](https://learn.microsoft.com/en-us/dotnet/api/system.uri 'System\.Uri') object for the specified content path\.

### Example

```csharp
// Static content
var uri1 = uriResolver.Content("~/content/site.css");
// Result: "https://example.com/content/site.css"

// Route template constant (uses configured or default path)
var uri2 = uriResolver.Content(Path.Authorize);
// Result: "https://example.com/connect/authorize"
```
