ControllerEndpointRouteBuilderExtensions.MapDynamicControllerRoute Method
Definition
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.
Overloads
MapDynamicControllerRoute<TTransformer>(IEndpointRouteBuilder, String) |
Adds a specialized RouteEndpoint to the IEndpointRouteBuilder that will
attempt to select a controller action using the route values produced by |
MapDynamicControllerRoute<TTransformer>(IEndpointRouteBuilder, String, Object) |
Adds a specialized RouteEndpoint to the IEndpointRouteBuilder that will
attempt to select a controller action using the route values produced by |
MapDynamicControllerRoute<TTransformer>(IEndpointRouteBuilder, String, Object, Int32) |
Adds a specialized RouteEndpoint to the IEndpointRouteBuilder that will
attempt to select a controller action using the route values produced by |
MapDynamicControllerRoute<TTransformer>(IEndpointRouteBuilder, String)
Adds a specialized RouteEndpoint to the IEndpointRouteBuilder that will
attempt to select a controller action using the route values produced by TTransformer
.
public:
generic <typename TTransformer>
where TTransformer : Microsoft::AspNetCore::Mvc::Routing::DynamicRouteValueTransformer[System::Runtime::CompilerServices::Extension]
static void MapDynamicControllerRoute(Microsoft::AspNetCore::Routing::IEndpointRouteBuilder ^ endpoints, System::String ^ pattern);
public static void MapDynamicControllerRoute<TTransformer> (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern) where TTransformer : Microsoft.AspNetCore.Mvc.Routing.DynamicRouteValueTransformer;
static member MapDynamicControllerRoute : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string -> unit (requires 'ransformer :> Microsoft.AspNetCore.Mvc.Routing.DynamicRouteValueTransformer)
<Extension()>
Public Sub MapDynamicControllerRoute(Of TTransformer As DynamicRouteValueTransformer) (endpoints As IEndpointRouteBuilder, pattern As String)
Type Parameters
- TTransformer
The type of a DynamicRouteValueTransformer.
Parameters
- endpoints
- IEndpointRouteBuilder
The IEndpointRouteBuilder to add the route to.
- pattern
- String
The URL pattern of the route.
Remarks
This method allows the registration of a RouteEndpoint and DynamicRouteValueTransformer that combine to dynamically select a controller action using custom logic.
The instance of TTransformer
will be retrieved from the dependency injection container. Register TTransformer
with the desired service lifetime in ConfigureServices
.
Applies to
MapDynamicControllerRoute<TTransformer>(IEndpointRouteBuilder, String, Object)
Adds a specialized RouteEndpoint to the IEndpointRouteBuilder that will
attempt to select a controller action using the route values produced by TTransformer
.
public:
generic <typename TTransformer>
where TTransformer : Microsoft::AspNetCore::Mvc::Routing::DynamicRouteValueTransformer[System::Runtime::CompilerServices::Extension]
static void MapDynamicControllerRoute(Microsoft::AspNetCore::Routing::IEndpointRouteBuilder ^ endpoints, System::String ^ pattern, System::Object ^ state);
public static void MapDynamicControllerRoute<TTransformer> (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern, object state) where TTransformer : Microsoft.AspNetCore.Mvc.Routing.DynamicRouteValueTransformer;
public static void MapDynamicControllerRoute<TTransformer> (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern, object? state) where TTransformer : Microsoft.AspNetCore.Mvc.Routing.DynamicRouteValueTransformer;
static member MapDynamicControllerRoute : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string * obj -> unit (requires 'ransformer :> Microsoft.AspNetCore.Mvc.Routing.DynamicRouteValueTransformer)
<Extension()>
Public Sub MapDynamicControllerRoute(Of TTransformer As DynamicRouteValueTransformer) (endpoints As IEndpointRouteBuilder, pattern As String, state As Object)
Type Parameters
- TTransformer
The type of a DynamicRouteValueTransformer.
Parameters
- endpoints
- IEndpointRouteBuilder
The IEndpointRouteBuilder to add the route to.
- pattern
- String
The URL pattern of the route.
- state
- Object
A state object to provide to the TTransformer
instance.
Remarks
This method allows the registration of a RouteEndpoint and DynamicRouteValueTransformer that combine to dynamically select a controller action using custom logic.
The instance of TTransformer
will be retrieved from the dependency injection container. Register TTransformer
as transient in ConfigureServices
. Using the transient lifetime is required when using state
.
Applies to
MapDynamicControllerRoute<TTransformer>(IEndpointRouteBuilder, String, Object, Int32)
Adds a specialized RouteEndpoint to the IEndpointRouteBuilder that will
attempt to select a controller action using the route values produced by TTransformer
.
public:
generic <typename TTransformer>
where TTransformer : Microsoft::AspNetCore::Mvc::Routing::DynamicRouteValueTransformer[System::Runtime::CompilerServices::Extension]
static void MapDynamicControllerRoute(Microsoft::AspNetCore::Routing::IEndpointRouteBuilder ^ endpoints, System::String ^ pattern, System::Object ^ state, int order);
public static void MapDynamicControllerRoute<TTransformer> (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern, object state, int order) where TTransformer : Microsoft.AspNetCore.Mvc.Routing.DynamicRouteValueTransformer;
static member MapDynamicControllerRoute : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string * obj * int -> unit (requires 'ransformer :> Microsoft.AspNetCore.Mvc.Routing.DynamicRouteValueTransformer)
<Extension()>
Public Sub MapDynamicControllerRoute(Of TTransformer As DynamicRouteValueTransformer) (endpoints As IEndpointRouteBuilder, pattern As String, state As Object, order As Integer)
Type Parameters
- TTransformer
The type of a DynamicRouteValueTransformer.
Parameters
- endpoints
- IEndpointRouteBuilder
The IEndpointRouteBuilder to add the route to.
- pattern
- String
The URL pattern of the route.
- state
- Object
A state object to provide to the TTransformer
instance.
- order
- Int32
The matching order for the dynamic route.
Remarks
This method allows the registration of a RouteEndpoint and DynamicRouteValueTransformer that combine to dynamically select a controller action using custom logic.
The instance of TTransformer
will be retrieved from the dependency injection container. Register TTransformer
as transient in ConfigureServices
. Using the transient lifetime is required when using state
.