本文整理汇总了C#中RouteValueDictionary.Encode方法的典型用法代码示例。如果您正苦于以下问题:C# RouteValueDictionary.Encode方法的具体用法?C# RouteValueDictionary.Encode怎么用?C# RouteValueDictionary.Encode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RouteValueDictionary
的用法示例。
在下文中一共展示了RouteValueDictionary.Encode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetVirtualPath
/// <summary>
/// Returns data about the url associated with the route (outbound request)
/// </summary>
/// <param name="requestContext">Context data about the requested route</param>
/// <param name="values">The route values</param>
/// <returns>Url data</returns>
public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values)
{
if (null != values)
{
values.Encode();
}
return base.GetVirtualPath(requestContext, values);
}
示例2: ShouldEncodeAllValues
public void ShouldEncodeAllValues()
{
RouteValueDictionary expected = new RouteValueDictionary(new {
controller = "this-controller",
action = "this-action",
argument1 = "this-argument",
argument2 = 3
});
RouteValueDictionary actual = new RouteValueDictionary(new {
controller = "This Controller",
action = "This Action",
argument1 = "This Argument",
argument2 = 3
});
actual.Encode();
RoutingAssert.AreDictionariesEqual(expected, actual);
}