RouteData Class¶
Information about the current routing path.
- Namespace
Microsoft.AspNetCore.Routing
- Assemblies
- Microsoft.AspNetCore.Routing.Abstractions
Inheritance Hierarchy¶
System.Object
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> toMicrosoft.AspNetCore.Routing.RouteData.Routers
, merging <em>values</em> intoMicrosoft.AspNetCore.Routing.RouteData.Values
, and merging <em>dataTokens</em> intoMicrosoft.AspNetCore.Routing.RouteData.DataTokens
. </p> <p> CallMicrosoft.AspNetCore.Routing.RouteData.RouteDataSnapshot.Restore
to restore the state of thisMicrosoft.AspNetCore.Routing.RouteData
to the state at the time of callingMicrosoft.AspNetCore.Routing.RouteData.PushState(Microsoft.AspNetCore.Routing.IRouter,Microsoft.AspNetCore.Routing.RouteValueDictionary,Microsoft.AspNetCore.Routing.RouteValueDictionary)
. </p>Arguments: - router (Microsoft.AspNetCore.Routing.IRouter) – An
Microsoft.AspNetCore.Routing.IRouter
to append toMicrosoft.AspNetCore.Routing.RouteData.Routers
. If <code>null</code>, thenMicrosoft.AspNetCore.Routing.RouteData.Routers
will not be changed. - values (Microsoft.AspNetCore.Routing.RouteValueDictionary) – A
Microsoft.AspNetCore.Routing.RouteValueDictionary
to merge intoMicrosoft.AspNetCore.Routing.RouteData.Values
. If <code>null</code>, thenMicrosoft.AspNetCore.Routing.RouteData.Values
will not be changed. - dataTokens (Microsoft.AspNetCore.Routing.RouteValueDictionary) – A
Microsoft.AspNetCore.Routing.RouteValueDictionary
to merge intoMicrosoft.AspNetCore.Routing.RouteData.DataTokens
. If <code>null</code>, thenMicrosoft.AspNetCore.Routing.RouteData.DataTokens
will not be changed.
Return type: Returns: A
Microsoft.AspNetCore.Routing.RouteData.RouteDataSnapshot
that captures the current state.public RouteData.RouteDataSnapshot PushState(IRouter router, RouteValueDictionary values, RouteValueDictionary dataTokens)
- router (Microsoft.AspNetCore.Routing.IRouter) – An
-