Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
LinkGenerator Class
Definition
- Namespace:
- Microsoft.AspNetCore.Routing
- Assembly:
- Microsoft.AspNetCore.Routing.Abstractions.dll
- Package:
- Microsoft.AspNetCore.App.Ref v10.0.0
- Package:
- Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
- Package:
- Microsoft.AspNetCore.Routing.Abstractions v2.2.0
- Package:
- Microsoft.AspNetCore.App.Ref v3.0.1
- Package:
- Microsoft.AspNetCore.App.Ref v3.1.10
- Package:
- Microsoft.AspNetCore.App.Ref v5.0.0
- Package:
- Microsoft.AspNetCore.App.Ref v6.0.36
- Package:
- Microsoft.AspNetCore.App.Ref v7.0.5
- Package:
- Microsoft.AspNetCore.App.Ref v8.0.19
- Package:
- Microsoft.AspNetCore.App.Ref v9.0.8
- Source:
- LinkGenerator.cs
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Defines a contract to generate absolute and related URIs based on endpoint routing.
public ref class LinkGenerator abstract
public abstract class LinkGenerator
type LinkGenerator = class
Public MustInherit Class LinkGenerator
- Inheritance
-
LinkGenerator
Remarks
Generating URIs in endpoint routing occurs in two phases. First, an address is bound to a list of endpoints that match the address. Secondly, each endpoint's RoutePattern is evaluated, until a route pattern that matches the supplied values is found. The resulting output is combined with the other URI parts supplied to the link generator and returned.
The methods provided by the LinkGenerator type are general infrastructure, and support the standard link generator functionality for any type of address. The most convenient way to use LinkGenerator is through extension methods that perform operations for a specific address type.
Constructors
| Name | Description |
|---|---|
| LinkGenerator() | |
Methods
| Name | Description |
|---|---|
| GetPathByAddress<TAddress>(HttpContext, TAddress, RouteValueDictionary, RouteValueDictionary, Nullable<PathString>, FragmentString, LinkOptions) |
Generates a URI with an absolute path based on the provided values and HttpContext. |
| GetPathByAddress<TAddress>(TAddress, RouteValueDictionary, PathString, FragmentString, LinkOptions) |
Generates a URI with an absolute path based on the provided values. |
| GetUriByAddress<TAddress>(HttpContext, TAddress, RouteValueDictionary, RouteValueDictionary, String, Nullable<HostString>, Nullable<PathString>, FragmentString, LinkOptions) |
Generates an absolute URI based on the provided values and HttpContext. |
| GetUriByAddress<TAddress>(TAddress, RouteValueDictionary, String, HostString, PathString, FragmentString, LinkOptions) |
Generates an absolute URI based on the provided values. |
Extension Methods
Applies to
Feedback
Was this page helpful?
