RouteData Class

Information about the current routing path.

Namespace
Microsoft.AspNetCore.Routing
Assemblies
  • Microsoft.AspNetCore.Routing.Abstractions

Syntax

public class RouteData
class Microsoft.AspNetCore.Routing.RouteData

Constructors

RouteData()

Creates a new Microsoft.AspNetCore.Routing.RouteData instance.

public RouteData()
RouteData(Microsoft.AspNetCore.Routing.RouteData)

Creates a new Microsoft.AspNetCore.Routing.RouteData instance with values copied from <em>other</em>.

Arguments:other (Microsoft.AspNetCore.Routing.RouteData) – The other Microsoft.AspNetCore.Routing.RouteData instance to copy.
public RouteData(RouteData other)

Properties

Microsoft.AspNetCore.Routing.RouteData.DataTokens

Gets the data tokens produced by routes on the current routing path.

Return type:Microsoft.AspNetCore.Routing.RouteValueDictionary
public RouteValueDictionary DataTokens { get; }
Microsoft.AspNetCore.Routing.RouteData.Routers

Gets the list of Microsoft.AspNetCore.Routing.IRouter instances on the current routing path.

Return type:System.Collections.Generic.IList<Microsoft.AspNetCore.Routing.IRouter>
public IList<IRouter> Routers { get; }
Microsoft.AspNetCore.Routing.RouteData.Values

Gets the set of values produced by routes on the current routing path.

Return type:Microsoft.AspNetCore.Routing.RouteValueDictionary
public RouteValueDictionary Values { get; }

Methods

PushState(Microsoft.AspNetCore.Routing.IRouter, Microsoft.AspNetCore.Routing.RouteValueDictionary, Microsoft.AspNetCore.Routing.RouteValueDictionary)

<p> Creates a snapshot of the current state of the Microsoft.AspNetCore.Routing.RouteData before appending <em>router</em> to Microsoft.AspNetCore.Routing.RouteData.Routers, merging <em>values</em> into Microsoft.AspNetCore.Routing.RouteData.Values, and merging <em>dataTokens</em> into Microsoft.AspNetCore.Routing.RouteData.DataTokens. </p> <p> Call Microsoft.AspNetCore.Routing.RouteData.RouteDataSnapshot.Restore to restore the state of this Microsoft.AspNetCore.Routing.RouteData to the state at the time of calling Microsoft.AspNetCore.Routing.RouteData.PushState(Microsoft.AspNetCore.Routing.IRouter,Microsoft.AspNetCore.Routing.RouteValueDictionary,Microsoft.AspNetCore.Routing.RouteValueDictionary). </p>

Arguments:
Return type:

Microsoft.AspNetCore.Routing.RouteData.RouteDataSnapshot

Returns:

A Microsoft.AspNetCore.Routing.RouteData.RouteDataSnapshot that captures the current state.

public RouteData.RouteDataSnapshot PushState(IRouter router, RouteValueDictionary values, RouteValueDictionary dataTokens)